getConnectivity method
Implementation
void getConnectivity(BuildContext context) {
subscription = Connectivity().onConnectivityChanged.listen(
(ConnectivityResult result) async {
print("connect");
isDeviceConnected = await InternetConnectionChecker().hasConnection;
print(isDeviceConnected);
if (!isDeviceConnected) {
handleOffline();
} else {
processOfflineEvents();
}
},
);
}