xxxxxxxxxx
#add f(luttertoast:<latest-version>) dependency to your pubspec
#if its giving no platform set for toast then simple just unistall
#app from phone and re-run
Future<bool?> showToastMessage(message, color)
{
return Fluttertoast.showToast(
msg: message,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: color,
textColor: Colors.white,
fontSize: 16.0
);
}
xxxxxxxxxx
# add this line to your dependencies
# put the current version
fluttertoast: ^8.0.9
# import file
import 'package:fluttertoast/fluttertoast.dart';
# Usage
Fluttertoast.showToast(
msg: "This is Center Short Toast",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0
);
xxxxxxxxxx
This will show the Flutter toast
Fluttertoast.showToast(msg: "Sending Message"),