pubspec.yaml
fluttertoast: ^7.1.6
toast.dart
void showWarnToast(String text) {
Fluttertoast.showToast(
msg: text,
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.CENTER,
backgroundColor: Colors.red,
textColor: Colors.white);
}
void showToast(String text) {
Fluttertoast.showToast(
msg: text, toastLength: Toast.LENGTH_LONG, textColor: Colors.white);
}