WiFiFlutter icon indicating copy to clipboard operation
WiFiFlutter copied to clipboard

onScannedResultsAvailable,Will not update automatically when wifi list changes

Open Jay-57blocks opened this issue 1 year ago • 0 comments

  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.

Jay-57blocks avatar Nov 27 '23 06:11 Jay-57blocks