onConnectivityChanged method
Implementation
@override
@mustCallSuper
void onConnectivityChanged(ConnectivityResult result) {
_connectivityStatus = result.name;
final nowOnline = App.isOnline;
// Connectivity was turned on
if (_wasOffline && nowOnline) {
_wasOffline = false;
_turnedOnInternet = true;
_turnedOffInternet = false;
} else
// Connectivity was turned off
if (!_wasOffline && !nowOnline) {
_wasOffline = true;
_turnedOnInternet = false;
_turnedOffInternet = true;
} else {
_turnedOnInternet = false;
_turnedOffInternet = false;
}
}