checkNetwork method

Future<bool> checkNetwork(
  1. BuildContext context
)

Implementation

Future<bool> checkNetwork(BuildContext context) async {
  var result = await Connectivity().checkConnectivity();
  if (result != ConnectivityResult.none) return true;
  Fluttertoast.showToast(msg: S.of(context).networkErrorTip);
  return false;
}