Infrastructure low complexity Shared Component mobile
0
Dependencies
1
Dependents
0
Entities
0
Integrations

Description

Monitors device network connectivity using the connectivity_plus Flutter package and exposes reactive streams of connectivity state changes. Triggers sync service on connectivity-restored events and suppresses sync attempts when offline. Provides a simple API for services and blocs to query current connectivity status or subscribe to changes.

Feature: Offline Support & Data Sync

connectivity-infrastructure

Responsibilities

  • Monitor network connectivity state changes via connectivity_plus
  • Emit connectivity events (online, offline, type-changed) to subscribers
  • Trigger sync service callback on transition from offline to online
  • Provide synchronous connectivity check for optimistic UI decisions

Interfaces

isOnline(): bool
getConnectivityStream(): Stream<ConnectivityStatus>
getCurrentConnectivity(): Future<ConnectivityStatus>
onConnectivityRestored(callback: VoidCallback): StreamSubscription
onConnectivityLost(callback: VoidCallback): StreamSubscription
dispose(): void

Relationships

Dependents (1)

Components that depend on this component