WiFiFlutter
WiFiFlutter copied to clipboard
onScannedResultsAvailable,Will not update automatically when wifi list changes
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.