mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 22:44:21 +01:00
Show error toast for 5xx error
This commit is contained in:
@@ -144,6 +144,20 @@ class _ChatViewState extends State<ChatView> {
|
||||
"linear-gradient(to right, #dc1c13, #dc1c13)",
|
||||
textColor: Colors.white,
|
||||
fontSize: 16.0);
|
||||
} else if (response is http.Response &&
|
||||
response.statusCode >= 500 &&
|
||||
response.statusCode < 600) {
|
||||
Fluttertoast.showToast(
|
||||
msg: "500 error: Something went wrong",
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.TOP,
|
||||
timeInSecForIosWeb: 5,
|
||||
backgroundColor: Colors.red,
|
||||
webPosition: "center",
|
||||
webBgColor:
|
||||
"linear-gradient(to right, #dc1c13, #dc1c13)",
|
||||
textColor: Colors.white,
|
||||
fontSize: 16.0);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user