Offline Support

This commit is contained in:
2026-04-27 06:20:39 +08:00
parent 7d8851a94a
commit 48cd3bcd60
121 changed files with 14798 additions and 2214 deletions
@@ -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);
}