flutter_network_state 1.1.0 copy "flutter_network_state: ^1.1.0" to clipboard
flutter_network_state: ^1.1.0 copied to clipboard

Network-aware state management engine for Flutter. Offline queue, cache strategies, Dio interceptor, auto-sync, and Bloc-friendly sealed states.

Changelog #

1.1.0 #

πŸš€ Feature Release #

Persistent Queue

  • Added PersistentQueueStore β€” JSON file-based queue that survives app restarts
  • Added SerializableRequest model for disk-safe HTTP request metadata
  • Added RequestExecutor callback for replaying persisted requests
  • Added HiveQueueStore reference implementation (doc/hive_queue_store.md)
  • Added SqfliteQueueStore reference implementation (doc/sqflite_queue_store.md)

Real Internet Verification

  • Added InternetChecker β€” DNS lookup-based connectivity verification
  • Detects captive portals, DNS failures, and firewalled connections
  • Periodic monitoring with deduped status stream

Reactive Widgets

  • Added NetworkBuilder β€” rebuilds UI based on NetworkState stream
  • Added ConnectivityBuilder β€” shows online/offline UI branches

State Management

  • Added NetworkNotifier extension for Provider (ChangeNotifier)
  • Added NetworkCubit standalone Cubit base class
  • Added NetworkStateNotifier extension for Riverpod

Testing

  • Added 80+ unit tests covering core, cache, queue, persistent queue, and retry

Dependencies

  • Upgraded connectivity_plus to ^7.0.0
  • Upgraded meta to ^1.16.0
  • Bumped minimum Flutter version to >=3.19.0

Fixes

  • Fixed GitHub repository URLs for pub.flutter-io.cn
  • Shortened package description for pub.flutter-io.cn compliance

1.0.0 #

πŸŽ‰ Initial Release #

Core

  • Sealed NetworkState hierarchy: Idle, Loading, Offline, Syncing, Success<T>, Error
  • Sealed NetworkStrategy: NetworkFirst, CacheFirst, CacheOnly, NetworkOnly
  • Stream-based NetworkStatusMonitor wrapping connectivity_plus
  • Pluggable NetworkLogger with severity levels (debug, info, warning, error)

Request Orchestration

  • NetworkManager.request<T>() API with strategy-based resolution
  • Automatic cache fallback on network failure (NetworkFirst / CacheFirst)
  • Offline request queueing with per-request retry policies

Cache

  • In-memory CacheManager with TTL support
  • Pluggable CacheStore interface for custom persistence (Hive, Isar, etc.)

Queue & Sync

  • FIFO RequestQueue with pluggable QueueStore
  • SyncEngine β€” automatically drains queue on connectivity restore
  • Progress tracking via Syncing state (completedRequests / totalRequests)

Retry

  • RetryPolicy with configurable max retries
  • ExponentialBackoff with Β±25% jitter
  • LinearBackoff and ConstantBackoff alternatives
  • Custom shouldRetry predicate support

Dio Integration

  • NetworkDioInterceptor β€” drop-in interceptor for any Dio instance
  • Auto-retry on transient failures (timeouts, 500, 502, 503, 429)
  • Automatic offline queueing and replay
  • Configurable request/response/error logging

State Management

  • NetworkNotifier β€” ChangeNotifier wrapper for Provider
  • NetworkCubit β€” standalone Cubit base class (no flutter_bloc dependency)
  • executeAndEmit() / bindToEmit() β€” extensions for flutter_bloc Cubit/Bloc
  • NetworkStateNotifier β€” Riverpod-compatible notifier with execute() helper
  • createNotifier() β€” extension on NetworkManager for Riverpod providers
  • asNetworkStates() β€” transform any Stream<T> into Stream<NetworkState>
  • Zero external state management dependencies β€” all built on Flutter SDK primitives
6
likes
160
points
27
downloads

Documentation

API reference

Publisher

verified publisherridltech.my.id

Weekly Downloads

Network-aware state management engine for Flutter. Offline queue, cache strategies, Dio interceptor, auto-sync, and Bloc-friendly sealed states.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

connectivity_plus, dio, flutter, meta

More

Packages that depend on flutter_network_state