How to display a toast message in flutter ?

Oliver Felix
May 1, 2021
  1. 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,

--

--