showToast method
dynamic
showToast(
- String msg,
- BuildContext _context, {
- bool isError = false,
- bool isSuccess = true,
Shows a toast message
Implementation
showToast(String msg, BuildContext _context,
{bool isError = false, bool isSuccess = true}) {
try {
ScaffoldMessenger.of(_context).showSnackBar(SnackBar(
content: Text(msg),
backgroundColor: isError ? AllColors().RED : AllColors().GREEN,
dismissDirection: DismissDirection.horizontal,
));
} catch (e) {
CustomToast().show(msg, navKey.currentContext!,
isError: isError, isSuccess: isSuccess);
}
}