How to display a toast message in flutter ?
May 1, 2021
- First you need to import the package
import 'package:fluttertoast/fluttertoast.dart';
2. Then show your toast like this.
Fluttertoast.showToast(
msg: "Your Message here!",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.green,
textColor: Colors.white,
fontSize: 16.0);
NOTE : if you need to show the toast in bottom change gravity as BOTTOM
gravity: ToastGravity.BOTTOM,