isConnected static method

Future<bool> isConnected()

Returns whether the device is connected to a Wi-Fi network. Note that this does not necessarily mean that the network is accessible.

@ returns True if connected to a Wi-Fi network, false otherwise.

Implementation

static Future<bool> isConnected() async {
  final Map<String, String> htArguments = Map();
  bool? bResult;
  try {
    bResult = await _channel.invokeMethod('isConnected', htArguments);
  } on MissingPluginException catch (e) {
    print("MissingPluginException : ${e.toString()}");
  }
  return bResult ?? false;
}