Skip to content

Commit

Permalink
docs(connectivity_plus): Specify behavior when there is no connectivi… (
Browse files Browse the repository at this point in the history
  • Loading branch information
huycn authored Mar 25, 2024
1 parent 26047f3 commit 8f132a2
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class Connectivity {
/// On Android, the Stream may emit new values even when
/// the [ConnectivityResult] list remains the same.
///
/// The emitted list is never empty. In case of no connectivity, the list contains
/// a single element of [ConnectivityResult.none]. Note also that this is the only
/// case where [ConnectivityResult.none] is present.
///
/// This method doesn't filter events, nor it ensures distinct values.
Stream<List<ConnectivityResult>> get onConnectivityChanged {
return _platform.onConnectivityChanged;
Expand All @@ -51,9 +55,12 @@ class Connectivity {
/// Checks the connection status of the device.
///
/// Do not use the result of this function to decide whether you can reliably
/// make a network request. It only gives you the radio status.
/// make a network request, it only gives you the radio status. Instead, listen
/// for connectivity changes via [onConnectivityChanged] stream.
///
/// Instead listen for connectivity changes via [onConnectivityChanged] stream.
/// The returned list is never empty. In case of no connectivity, the list contains
/// a single element of [ConnectivityResult.none]. Note also that this is the only
/// case where [ConnectivityResult.none] is present.
Future<List<ConnectivityResult>> checkConnectivity() {
return _platform.checkConnectivity();
}
Expand Down

0 comments on commit 8f132a2

Please sign in to comment.