MousyBusiness / flutter_iot_wifi

MIT License
1 stars 3 forks source link

The wifi connection on IOS is not valid #5

Open Zqiang12345 opened 7 months ago

Danielbzg commented 5 months ago

I have the same problem. Network scanning AND network listing functions are not implemented for iOS.

static Future<bool?> scan() async {
    if (Platform.isIOS) {
      print("NOT IMPLEMENTED");
      return false;
    }
    final scan = await _channel.invokeMethod('scan');
    return scan;
  }

  static Future<List<String>> list() async {
    if (Platform.isIOS) {
      print("NOT IMPLEMENTED");
      return [];
    }

    final ssids= <String>[];
    final list = await _channel.invokeMethod('list');
    if(list != null){
      for(final l in list){
        if(l != null){
          ssids.add(l as String);
        }
      }
    }
    return ssids;
  }