connectivity_plus_watchos 0.2.1
connectivity_plus_watchos: ^0.2.1 copied to clipboard
watchOS implementation of the connectivity_plus plugin, reporting network reachability (wifi, cellular, or none) from NWPathMonitor via dart:ffi.
0.2.1 #
Fixed
- The first value is the real one, not
none. The native cache started as "none", and the path monitor starts only on first use, so the firstcheckConnectivity()and the first event ofonConnectivityChangedreported[none], followed a few milliseconds later by the real value. The cache now starts as "unknown". Both register for changes before they read, and while the value is unknown they wait for the monitor's first path, for at most one second, and then reportnone. - Comments and
PORTING_REPORT.mdno longer say that Dart polls the cache. Changes are pushed.
Docs
- README: the install snippet names
connectivity_plus: ^7.3.1and this version, and says to add this package alongsideconnectivity_plus. pubspec.yaml:repositorypoints at this package's folder in the plugins repo.- Comments now say what keeps the FFI exports in the app: the CLI force-loads
the plugin archive, each export is
usedwith default visibility, and the CLI keeps global symbols through the App Store strip.ffiSymbolslists the exports. - README: a "Not supported on watchOS" table; PORTING_REPORT: an "Interface
coverage" list of every member of
connectivity_plus_platform_interface2.1.0, audited by hand. - Example:
pubspec.yamlnamesconnectivity_plus: ^7.3.1instead ofany. - Example: the runner sets
FlutterWatchOSContentScaleto 0.5, so the phone example no longer overflows the watch screen (by 88 px on a 49 mm Simulator). A widget test lays it out at that scale on every watch screen size, and the README says why.
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.