Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
[connectivity_platform_interface] Add ConnectivityResult.unknown.
Browse files Browse the repository at this point in the history
Some platforms might not be able to determine the connectivity status of
the device on which the app is running (like some desktop Web browsers).

This allows users of the `connectivity` plugin to distinguish between
"no connectivity" and "connectivity couldn't be determined".

This requires a Major Version bump for users of the plugin who may be
switch/case on ConnectivityResult values, since Dart forces users to be
exhaustive in those cases (if they don't have a "default" entry, this
new value becomes a compilation error in their code).

This will also cause a Major Version bump in the core `connectivity`
plugin itself.
  • Loading branch information
ditman committed Feb 27, 2020
1 parent 09f29e4 commit 84bf52a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.0

* Added `ConnectivityResult.unknown`, for the cases where the plugin is unable to determine the
connectivity status of the device. _(This happens mostly in the `web` platform.)_

## 1.0.2

* Bring ConnectivityResult and LocationAuthorizationStatus enums from the core package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ enum ConnectivityResult {
mobile,

/// None: Device not connected to any network
none
none,

/// Unknown: The plugin wasn't able to determine the connectivity status of the device
unknown,
}

/// The status of the location service authorization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A common platform interface for the connectivity plugin.
homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 1.0.2
version: 2.0.0

dependencies:
flutter:
Expand Down

0 comments on commit 84bf52a

Please sign in to comment.