# add this line to your dependencies
fluttertoast: ^7.1.1
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
);
Scaffold.of(context).showSnackBar(SnackBar(
content: Text("Sending Message"),
));
Toast.show("Toast plugin app", duration: Toast.lengthShort, gravity: Toast.bottom);
dependencies:
fluttertoast: ^8.0.8
# 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
);
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
);
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text("Sending Message"),
));
// Learn Flutter inside VS Code at sideguide.dev/courses/flutter?ref=grepper
#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
);
}