Gracefully handle toast messages error on desktop platforms

This commit is contained in:
OmarHatem
2025-04-28 15:12:42 +03:00
parent d86c501fc5
commit e527083871
4 changed files with 31 additions and 23 deletions
+10 -8
View File
@@ -81,14 +81,16 @@ class LinkViewModel {
}
Future<void> _errorToast(String message, {double fontSize = 16}) async {
Fluttertoast.showToast(
msg: message,
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.SNACKBAR,
backgroundColor: Colors.black,
textColor: Colors.white,
fontSize: fontSize,
);
try {
await Fluttertoast.showToast(
msg: message,
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.SNACKBAR,
backgroundColor: Colors.black,
textColor: Colors.white,
fontSize: fontSize,
);
} catch (_) {}
}
Future<void> handleLink() async {