diff options
author | uvok | 2025-07-31 14:56:29 +0200 |
---|---|---|
committer | uvok | 2025-07-31 14:56:29 +0200 |
commit | 026d5e63a7f5a1137eceb987dcd3269348ac9ef5 (patch) | |
tree | d1510f6813983a73964a6f70faff2d2f35ba6dfa | |
parent | ac912d76d66e35008c48bce811f822b353141eb4 (diff) |
Add async linting
-rw-r--r-- | analysis_options.yaml | 2 | ||||
-rw-r--r-- | lib/control/flutter_blue_plus_scanner_controller.dart | 2 | ||||
-rw-r--r-- | lib/control/scanner_controller_impl.dart | 6 | ||||
-rw-r--r-- | lib/widgets/scan_page.dart | 7 |
4 files changed, 10 insertions, 7 deletions
diff --git a/analysis_options.yaml b/analysis_options.yaml index 0d29021..9097e22 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -21,6 +21,8 @@ linter: # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: + discarded_futures: true + unawaited_futures: true # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule diff --git a/lib/control/flutter_blue_plus_scanner_controller.dart b/lib/control/flutter_blue_plus_scanner_controller.dart index 13c38c6..d0a8fee 100644 --- a/lib/control/flutter_blue_plus_scanner_controller.dart +++ b/lib/control/flutter_blue_plus_scanner_controller.dart @@ -13,7 +13,7 @@ class FlutterBluePlusScannerController extends ScannerControllerImpl { Future<void> startScan({ Duration timeout = const Duration(seconds: 5), }) async { - stopScan(); + await stopScan(); var system = await FlutterBluePlus.systemDevices([]); for (var d in system) { diff --git a/lib/control/scanner_controller_impl.dart b/lib/control/scanner_controller_impl.dart index dbf5e00..4c2fa81 100644 --- a/lib/control/scanner_controller_impl.dart +++ b/lib/control/scanner_controller_impl.dart @@ -45,8 +45,8 @@ abstract class ScannerControllerImpl extends ScannerController { @override void dispose() { - _scanStatusController.close(); - _deviceContoller.close(); - _availabilityController.close(); + _scanStatusController.close().ignore(); + _deviceContoller.close().ignore(); + _availabilityController.close().ignore(); } } diff --git a/lib/widgets/scan_page.dart b/lib/widgets/scan_page.dart index 0280889..bcb3525 100644 --- a/lib/widgets/scan_page.dart +++ b/lib/widgets/scan_page.dart @@ -46,8 +46,8 @@ class _ScanPageState extends State<ScanPage> { final DeviceConnection connection = DeviceConnectionFactory.createConnection(dev); - //??? - Navigator.push( + + await Navigator.push( context, MaterialPageRoute( builder: (context) => @@ -76,7 +76,8 @@ class _ScanPageState extends State<ScanPage> { @override void initState() { super.initState(); - getPermissions(); + // ehhh... + getPermissions().ignore(); } @override |