flutternetwork / WiFiFlutter

Flutter plugin suite for various WiFi services.
https://wifi.flutternetwork.dev
289 stars 182 forks source link

onScannedResultsAvailable,Will not update automatically when wifi list changes #358

Open Jay-57blocks opened 11 months ago

Jay-57blocks commented 11 months ago
  Future<void> _startListeningToScanResults(BuildContext context) async {
    if (await _canGetScannedResults(context)) {
      subscription = WiFiScan.instance.onScannedResultsAvailable
          .listen((result) => setState(() => accessPoints = result));
    }
  }

Will not update automatically when wifi list changes,StartScan needs to be called to update, so if I need to get the latest wifi list, I need to use a timer and call startScan every 5 seconds. This is too strange.