haveConnectivity function
Implementation
Future<bool> haveConnectivity({bool showToast = true}) async {
var connection = await Connectivity().checkConnectivity();
if (connection == ConnectivityResult.none && showToast) {
Fluttertoast.showToast(msg: S.of().networkErrorTip);
}
return connection != ConnectivityResult.none;
}