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
+10 -2
View File
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../providers/realtime_controller.dart';
import '../providers/sync_queue_provider.dart';
/// Subtle, non-blocking connection status indicator.
/// Shows in the bottom-right corner when streams are recovering/stale.
@@ -18,12 +19,19 @@ class ReconnectIndicator extends ConsumerWidget {
return const SizedBox.shrink();
}
final pendingCount = ref.watch(pendingSyncCountProvider);
// Build a human-readable label for recovering channels.
final channels = ctrl.recoveringChannels;
final label = channels.length <= 2
final channelLabel = channels.length <= 2
? channels.map(_humanize).join(', ')
: '${channels.length} channels';
final syncSuffix = pendingCount > 0
? ' — syncing $pendingCount item${pendingCount == 1 ? '' : 's'}'
: '';
final label = 'Reconnecting $channelLabel$syncSuffix';
return Positioned(
bottom: 16,
right: 16,
@@ -60,7 +68,7 @@ class ReconnectIndicator extends ConsumerWidget {
const SizedBox(width: 8),
Flexible(
child: Text(
'Reconnecting $label',
label,
style: Theme.of(context).textTheme.labelSmall,
overflow: TextOverflow.ellipsis,
),