Offline Support
This commit is contained in:
@@ -269,7 +269,14 @@ class _CreateAnnouncementContentState
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) showErrorSnackBar(context, 'Failed to save: $e');
|
||||
if (mounted) {
|
||||
if (isOfflineSaveError(e)) {
|
||||
Navigator.of(context).pop();
|
||||
showSuccessSnackBarGlobal('Announcement saved offline — will sync when connected.');
|
||||
} else {
|
||||
showErrorSnackBar(context, 'Failed to save: $e');
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (mounted) setState(() => _submitting = false);
|
||||
}
|
||||
@@ -537,7 +544,14 @@ class _BannerSettingsContentState
|
||||
if (mounted) Navigator.of(context).pop();
|
||||
showSuccessSnackBarGlobal('Banner settings saved.');
|
||||
} catch (e) {
|
||||
if (mounted) showErrorSnackBar(context, 'Failed to save: $e');
|
||||
if (mounted) {
|
||||
if (isOfflineSaveError(e)) {
|
||||
Navigator.of(context).pop();
|
||||
showSuccessSnackBarGlobal('Banner settings saved offline — will sync when connected.');
|
||||
} else {
|
||||
showErrorSnackBar(context, 'Failed to save: $e');
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (mounted) setState(() => _submitting = false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user