From 2ce86f3099e6c664fc3f469c4608d6aa31253adc Mon Sep 17 00:00:00 2001 From: Strycher Date: Wed, 29 Jul 2026 23:54:02 -0400 Subject: [PATCH] fix(#443): also show battery-optimization banner on the scanner screen Surface the warning on the connection/device-selection screen so the user can fix battery settings before connecting, not only after landing on the channels screen. Reuses BatteryOptimizationBanner (Android-only, self-checking). Co-Authored-By: Claude Opus 4.8 --- lib/screens/scanner_screen.dart | 35 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lib/screens/scanner_screen.dart b/lib/screens/scanner_screen.dart index e2f635a6..1ad1dc05 100644 --- a/lib/screens/scanner_screen.dart +++ b/lib/screens/scanner_screen.dart @@ -9,6 +9,7 @@ import '../l10n/l10n.dart'; import '../services/linux_ble_error_classifier.dart'; import '../utils/app_logger.dart'; import '../widgets/adaptive_app_bar_title.dart'; +import '../widgets/battery_optimization_banner.dart'; import '../widgets/device_tile.dart'; import '../helpers/snack_bar_builder.dart'; import 'channels_screen.dart'; @@ -121,24 +122,26 @@ class _ScannerScreenState extends State { centerTitle: true, automaticallyImplyLeading: false, ), - body: SafeArea( - top: false, - child: Consumer( - builder: (context, connector, child) { - return Column( - children: [ - // Bluetooth off warning - if (_bluetoothState == BluetoothAdapterState.off) - _bluetoothOffWarning(context), + body: BatteryOptimizationBanner( + child: SafeArea( + top: false, + child: Consumer( + builder: (context, connector, child) { + return Column( + children: [ + // Bluetooth off warning + if (_bluetoothState == BluetoothAdapterState.off) + _bluetoothOffWarning(context), - // Status bar - _buildStatusBar(context, connector), + // Status bar + _buildStatusBar(context, connector), - // Device list - Expanded(child: _buildDeviceList(context, connector)), - ], - ); - }, + // Device list + Expanded(child: _buildDeviceList(context, connector)), + ], + ); + }, + ), ), ), bottomNavigationBar: Consumer(