checkNetWork method
Implementation
Future<bool> checkNetWork([Function? callBack]) {
Future<bool> isOk = isConnected();
isOk.then((value) {
if (!value) {
Alert.showAlert('网络错误,请检查当前网络', callBack: () {
if (Get.currentRoute != Routes.login) {
// Get.offNamedUntil(Routes.login, (route) => false);
}
callBack?.call();
});
return;
}
});
return isOk;
}