Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emanuel-braz/connectivity_web
Flutter Web Connectivity Observer
https://github.com/emanuel-braz/connectivity_web
Last synced: 8 days ago
JSON representation
Flutter Web Connectivity Observer
- Host: GitHub
- URL: https://github.com/emanuel-braz/connectivity_web
- Owner: emanuel-braz
- License: bsd-3-clause
- Created: 2020-02-17T20:08:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-02-22T13:50:09.000Z (over 4 years ago)
- Last Synced: 2023-08-20T21:36:21.740Z (about 1 year ago)
- Language: Dart
- Size: 917 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter Web Package (connectivity_web)
A Flutter web package, that allows you to check internet status anytime or listen to event changes. There is a pre-built widget [OnOffWidget] to make things simple.![](preview/preview.gif?raw=true)
### Check internet status anytime
```dart
bool isOnline = ConnectivityWeb().isOnline.value;
```### Use the pre-built widget to display internet status in the screen
```dart
OnOffWidget(
online: Icon(Icons.signal_wifi_4_bar, color: Colors.green),
offline: Icon(Icons.signal_wifi_off, color: Colors.red)
);
```### Listen events
```dart
ConnectivityWeb().isOnline.observe((isOnline) {
if (isOnline.newValue != isOnline.oldValue) print(isOnline.newValue);
});
```## You can find the full example [here](https://github.com/emanuel-braz/connectivity_web/tree/master/example) with Observer, Reaction, StreamController and OnOffWidget.
## Browser Internet Status Compatibility
![](preview/onlineCompatibility.png?raw=true)## RTT Compatibility (Round-Trip Time) [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Contribute/Guidelines/Conventions_definitions#Experimental)
![](preview/rttCompatibility.png?raw=true)