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).network_error_tip);
  return false;
}