rx_connectivity_checker 1.0.0
rx_connectivity_checker: ^1.0.0 copied to clipboard
A robust, reactive Dart/Flutter package for monitoring network connectivity.
Changelog #
All notable changes to this project will be documented in this file.
1.0.0 #
Added #
- Federated Architecture — transitioned to a federated plugin model, adding native support for macOS, Windows, and Linux.
- Modern Web Support — migrated web implementation to use
package:webanddart:js_interopfor WASM compatibility. - Multi-Trigger System — added support for platform-native change events, periodic heartbeats, and manual on-demand checks.
- Platform Behaviour Documentation — added a platform-behaviour table to the README and
ConnectivityCheckerclass doc clearly stating thatcheckSlowConnectionis silently ignored on Windows (timeouts always map toofflineon that platform). - Dependency Injection —
IHttpClientis now a documented public interface, enabling full unit-test coverage without real network access. - MIT License — updated the project license from Apache 2.0 to MIT.
Changed #
- Internal Strategy Pattern — introduced
ReachabilityValidatorabstraction with conditional imports to improve build-time platform resolution and testability. defaultCheckUrlis now immutable — changed from a mutablestatic Stringtostatic const StringinConnectivityCheckerConstantsto prevent accidental global mutation by consumers.- Windows
platformStatusStreamis now cached —WindowsRxConnectivityCheckernow lazily initialises a single broadcast stream (matching the behaviour ofMethodChannelRxConnectivityChecker) to prevent multiple redundant native channel subscriptions. - Linux D-Bus client lifecycle —
LinuxRxConnectivityCheckernow closes theDBusClientsocket when the stream is cancelled, preventing file-descriptor leaks on hot-restart or widget disposal.
Fixed #
- Null-safety crash in
NativeReachabilityValidator— replaced the force-unwrapclient!with a null-coalescing fallback (client ?? DefaultHttpClient()). Callers who constructNativeReachabilityValidatordirectly without passing a client no longer receive aNull check operator used on a null valuecrash at runtime. - Removed internal
project_starter_kitdependency — replacedDebugLogger(from a private monorepo package) withdart:developer'slog()function so the package builds correctly as a standalone pub.dev library. - Web validator parameter contract —
WebReachabilityValidatornow asserts (in debug mode) thatclientandheadersare null, making the previously silent no-op explicit and discoverable during development. - Corrected an issue where
throttleTimewas unintentionally tied to thecheckFrequencyinterval. This caused manual connectivity checks to be suppressed when triggered shortly after a periodic check, makingcheckConnectivity()appear unresponsive.