diff --git a/lib/main.dart b/lib/main.dart index 84eaaab..fd65950 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -111,6 +111,29 @@ class _GoMixHomeState extends State { } }); } + + if (data["type"] == "error") { + String errorMessage = ""; + try { + errorMessage = data["responseData"]["error"]; + } catch (e) { + errorMessage = "Unknown error"; + } + + showDialog( + context: context, + builder: (BuildContext context) => AlertDialog( + title: const Text('Server error'), + content: Text(errorMessage), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, 'OK'), + child: const Text('OK'), + ), + ], + ), + ); + } }, onDone: () { wsConnected = false; if (connectionError.value != "") return;