Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Harsh Bhikadia
    @daadu
    Hello everyone, this is the chat room for WiFiFlutter.
    Maverick G. Fabroa
    @mavyfaby
    Hello
    Nils Bauer
    @nils-bauer
    Hi there!
    I'm using the flutter plugin in a project and like to provide help with the development of the wifi_basic module if needed.
    Hallot
    @Hallot
    Hello
    Harsh Bhikadia
    @daadu_gitlab
    Hello everyone
    @nils-bauer wifi_basic - I am a bit confused with it. Intially I want it to be zero-permission plugin - with just checks - like doesSupportWifi6, etc - but then I also added then added "info" related stuff - which requires various permissions - especially in iOS - to get current "SSID" - you can get it if the current wifi was connected by app without any additional perm, but if not then "location" is required, therefore not sure of the design as of now.
    Therefore the next one I am picking is wifi_connect - to connect, disconnect and register wifi networks - as it is the core functionaltiy - doing it first will clear a lot of doubts in my mind - regarding other plugins.
    Harsh Bhikadia
    @daadu_gitlab
    Also, did you guys had time to switch to wifi_scan need feedback, test and review on it
    Testing in WiFiFlutter is notorously hard - with different platform - various versions - etc. Also cannot be tested with "emulator", so will rely on your feedback - Since I dont have donzes of phones to test with
    Hallot
    @Hallot
    I'm looking at switching to wifi_scan, but the API is very verbose now.
    It's nice to be able to have some control over what's going on, but the previous WiFiForIoTPlugin.loadWifiList() was really convenient.
    What do you think of adding something like Future<Result<WiFiScanError, List<WifiAccessPoint>>> getWifiAccessPoints(boolean askPermissions)?
    Harsh Bhikadia
    @daadu_gitlab
    @Hallot Had similar discussion about it @ https://github.com/flutternetwork/WiFiFlutter/discussions/229
    2 different methods for check and execute - is just more vanilla than having wrapper class for holding multiple results, etc.
    also loadWifiList - is split to startScan and getScannedResults - due to restrictions in it and maybe future removal according to docs.
    Harsh Bhikadia
    @daadu_gitlab
    also deserializing result from platform would be more complex in case of Future<Result<WiFiScanError, List<WifiAccessPoint>>> getWifiAccessPoints(boolean askPermissions)
    It is a bit verbose though - calling two method to do one thing
    I will think about it

    I'm looking at switching to wifi_scan, but the API is very verbose now.

    @Hallot can you run example app and test if it works for the devices you have?

    2 replies
    Harsh Bhikadia
    @daadu_gitlab
    What would Result look like? Something like AsyncSnapshot ?
    final result = await WiFiScan.instance.getScannedResults(askPermissions: true);
    if(result.hasError){
      switch(result.error){
        case WiFiScanError.locationPermissionDenied:
          // ... handle
         break;
      }
    }else{
      // get by calling `result.data`
    }
    class Result<E, D>{
    
      // D for Data class?
      D? data;
      // E for Error class or enum
      E? error;
    
      bool get hasData => data != null;
      bool get hasError => error != null;
    }
    @Hallot something like the above?
    2 replies
    Looks like more or less same verbostiy compared to current implementation, except that two method needs to be called.
    Harsh Bhikadia
    @daadu_gitlab
    • in this case data and error are nullable - therefore if null-check enabled - needs to be handled everytime.
    Harsh Bhikadia
    @daadu_gitlab
    @all published new releases of wifi_scan and wifi_iot
    Harsh Bhikadia
    @daadu_gitlab
    @Hallot I have thought about your suggestion about the API design of wifi_scan and decided to implment it
    Please review and test the PR: flutternetwork/WiFiFlutter#246
    Harsh Bhikadia
    @daadu_gitlab