toast static method
Future<bool?>
toast(
{ - required String msg,
- Color backgroundColor = Colors.black,
- Color textColor = Colors.white,
- ToastGravity? gravity,
- Toast? toastLength,
})
Implementation
static Future<bool?> toast({
required String msg,
Color backgroundColor = Colors.black,
Color textColor = Colors.white,
ToastGravity? gravity,
Toast? toastLength,
}) =>
Fluttertoast.showToast(
msg: msg,
toastLength: toastLength ?? Toast.LENGTH_SHORT,
gravity: gravity ?? ToastGravity.TOP,
timeInSecForIosWeb: 1,
backgroundColor: backgroundColor,
webBgColor: '#${backgroundColor.value.toRadixString(16).substring(2, 8)}',
textColor: textColor,
fontSize: 16,
);