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
@@ -57,9 +57,12 @@ class _AnnouncementCommentsSectionState
}
} catch (e) {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Failed to post comment: $e')),
);
if (isOfflineSaveError(e)) {
_controller.clear();
showSuccessSnackBar(context, 'Comment saved offline — will sync when connected.');
} else {
showErrorSnackBar(context, 'Failed to post comment: $e');
}
}
} finally {
if (mounted) setState(() => _sending = false);