checkConnectivity method

Future<ConnectivityResult> checkConnectivity ()

Checks the connection status of the device.

Do not use the result of this function to decide whether you can reliably make a network request. It only gives you the radio status.

Instead listen for connectivity changes via onConnectivityChanged stream.


Future<ConnectivityResult> checkConnectivity() async {
  final String result = await methodChannel.invokeMethod<String>('check');
  return _parseConnectivityResult(result);