add platforminfo helper

This commit is contained in:
Ben Allfree
2026-02-22 06:54:27 -08:00
parent b3ad54f296
commit 6d63e49938
7 changed files with 49 additions and 14 deletions
+2 -2
View File
@@ -30,6 +30,7 @@ import '../storage/message_store.dart';
import '../storage/unread_store.dart';
import '../utils/app_logger.dart';
import '../utils/battery_utils.dart';
import '../utils/platform_info.dart';
import 'meshcore_protocol.dart';
class MeshCoreUuids {
@@ -693,8 +694,7 @@ class MeshCoreConnector extends ChangeNotifier {
await _scanSubscription?.cancel();
// On iOS/macOS, wait for Bluetooth to be powered on before scanning
if (defaultTargetPlatform == TargetPlatform.iOS ||
defaultTargetPlatform == TargetPlatform.macOS) {
if (PlatformInfo.isIOS || PlatformInfo.isMacOS) {
// Wait for adapter state to be powered on
final adapterState = await FlutterBluePlus.adapterState.first;
if (adapterState != BluetoothAdapterState.on) {