diff --git a/packages/connectivity_plus/connectivity_plus/README.md b/packages/connectivity_plus/connectivity_plus/README.md index acc674411f..3537fb754a 100644 --- a/packages/connectivity_plus/connectivity_plus/README.md +++ b/packages/connectivity_plus/connectivity_plus/README.md @@ -58,7 +58,9 @@ if (connectivityResult.contains(ConnectivityResult.mobile)) { ``` You can also listen for active connectivity types changes by subscribing to the stream -exposed by the plugin: +exposed by the plugin. + +This method should ensure emitting only distinct values. ```dart import 'package:connectivity_plus/connectivity_plus.dart'; @@ -99,6 +101,8 @@ _`none` is supported on all platforms by default._ Connectivity changes are no longer communicated to Android apps in the background starting with Android O (8.0). You should always check for connectivity status when your app is resumed. The broadcast is only useful when your application is in the foreground. +To ensure connectivity changes on Android are tracked correctly, an event containing `[ConnectivityResult.none]` may be emitted in during connectivity changes. e.g. Going from WiFi to mobile network may emit: `[wifi] -> [none] -> [mobile]`. + ### iOS & MacOS On iOS simulators, the connectivity types stream might not update when Wi-Fi status changes. This is a known issue.