isConnected method

  1. @override
Future<bool> isConnected()
override

Implementation

@override
Future<bool> isConnected() async {
  try {
    var connection = await connectivity.checkConnectivity();
    return [ConnectivityResult.wifi, ConnectivityResult.mobile].contains(
      connection,
    );
  } on PlatformException catch (_) {
    rethrow;
  }
}