connectivity_plus_watchos 0.2.0
connectivity_plus_watchos: ^0.2.0 copied to clipboard
watchOS implementation of the connectivity_plus plugin, reporting network reachability (wifi, cellular, or none) from NWPathMonitor via dart:ffi.
0.2.0 #
Breaking
pollIntervalis gone.onConnectivityChangedno longer polls, so there is no interval to tune.- Minimum Dart SDK is now 3.1.0, where
NativeCallable.listenerlanded.
Changed
onConnectivityChangedis pushed, not polled. TheNWPathMonitorupdate handler wakes Dart through aNativeCallable.listener; the 2-second timer that ran for the life of the app is gone. Connectivity changes a handful of times a day — it never justified a timer on a watch.- Native filters unchanged path updates, so
NWPathMonitorfiring on details this API cannot express no longer wakes the isolate.
Fixed
- Two listeners on
onConnectivityChangedno longer fight. The native side holds a single callback pointer, and registering per subscription let the newest listener silence every older one, while the first cancel unregistered the callback out from under the rest. All listeners now share one trampoline, and native is unregistered only once the last one cancels. - Every listener is seeded with the current connectivity, not just the
first. A broadcast stream's
onListenfires only on zero-to-one, so a second concurrent listener used to learn nothing until the network happened to change. Each listener also gets its own de-duplication state.
0.1.0 #
- First working release. FFI implementation over the Network framework's
NWPathMonitor; poll-basedonConnectivityChanged.
0.0.1 #
- Initial watchOS scaffolding generated by
flutter-watchos plugin portfromconnectivity_plus.