connectivity_web 0.1.0+2 connectivity_web: ^0.1.0+2 copied to clipboard
Flutter Web package, that allows you check internet status anytime or listen to change events, using the MobX lib as state management.
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.
Check internet status anytime #
bool isOnline = ConnectivityWeb().isOnline.value;
Use the pre-built widget to display internet status in the screen #
OnOffWidget(
online: Icon(Icons.signal_wifi_4_bar, color: Colors.green),
offline: Icon(Icons.signal_wifi_off, color: Colors.red)
);
Listen events #
ConnectivityWeb().isOnline.observe((isOnline) {
if (isOnline.newValue != isOnline.oldValue) print(isOnline.newValue);
});