Add various informative alert-boxes

This commit is contained in:
2025-11-09 21:31:03 +01:00
parent c108859899
commit fd5e714074
23 changed files with 426 additions and 130 deletions

View File

@@ -4,6 +4,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:simplecloudnotifier/api/api_client.dart';
import 'package:simplecloudnotifier/api/api_exception.dart';
import 'package:simplecloudnotifier/components/error_display/error_display.dart';
import 'package:simplecloudnotifier/state/application_log.dart';
import 'package:simplecloudnotifier/state/globals.dart';
@@ -289,6 +290,9 @@ class _SendRootPageState extends State<SendRootPage> {
_msgTitle.clear();
_msgContent.clear();
});
} on APIException catch (e, stackTrace) {
if (!e.toastShown) Toaster.error("Error", 'Failed to send message: ${e.toString()}');
ApplicationLog.error('Failed to send message', trace: stackTrace);
} catch (e, stackTrace) {
Toaster.error("Error", 'Failed to send message: ${e.toString()}');
ApplicationLog.error('Failed to send message', trace: stackTrace);
@@ -308,6 +312,9 @@ class _SendRootPageState extends State<SendRootPage> {
_msgTitle.clear();
_msgContent.clear();
});
} on APIException catch (e, stackTrace) {
if (!e.toastShown) Toaster.error("Error", 'Failed to send message: ${e.toString()}');
ApplicationLog.error('Failed to send message', trace: stackTrace);
} catch (e, stackTrace) {
Toaster.error("Error", 'Failed to send message: ${e.toString()}');
ApplicationLog.error('Failed to send message', trace: stackTrace);