feat: background streaming of responses

This commit is contained in:
cogwheel0
2025-08-16 20:27:44 +05:30
parent 33fc26d755
commit 9be04ef2b9
23 changed files with 2676 additions and 322 deletions

View File

@@ -20,6 +20,13 @@ class ConnectivityService {
Stream<ConnectivityStatus> get connectivityStream =>
_connectivityController.stream;
ConnectivityStatus get currentStatus => _lastStatus;
/// Stream that emits true when connected, false when offline
Stream<bool> get isConnected => connectivityStream
.map((status) => status == ConnectivityStatus.online);
/// Check if currently connected
bool get isCurrentlyConnected => _lastStatus == ConnectivityStatus.online;
void _startConnectivityMonitoring() {
// Initial check after a brief delay to avoid showing offline during startup