Check out example codes for "how to create a toast in flutter". It will help you in understanding the concepts better.

Code Example 1

# add this line to your dependencies
fluttertoast: ^7.1.1

        msg: "This is Center Short Toast",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
        timeInSecForIosWeb: 1,
        textColor: Colors.white,
        fontSize: 16.0

Code Example 2

You can show material design snackbars using the following code:

      content: Text("New Notification"),
In some cases, this will throw an error and it can be resolved using a workaround:

//Declare a GlobalKey
GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();

//Assing this key to the scaffold
  key: _scaffoldKey,
  body: ...

//finally in the topmost code use this key in the following way
      content: Text("New Notification"),

Learn ReactJs, React Native from