getWifiName method

  1. @override
Future<String?> getWifiName()
override

Obtains the wifi name (SSID) of the connected network

Implementation

@override
Future<String?> getWifiName() async {
  var wifiName = await methodChannel.invokeMethod<String>('wifiName');
  // as Android might return <unknown ssid>, uniforming result
  // our iOS implementation will return null
  if (wifiName == '<unknown ssid>') {
    wifiName = null;
  }
  return wifiName;
}