feat: better pairing broken notification
This commit is contained in:
@ -3,6 +3,10 @@ import 'dart:io';
|
||||
import 'package:app_settings/app_settings.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
bool isBluetoothPairingRecoveryError(Object error) {
|
||||
return error.toString().toLowerCase().contains('disconnected');
|
||||
}
|
||||
|
||||
Future<bool> openBluetoothSettings() async {
|
||||
try {
|
||||
if (Platform.isAndroid) {
|
||||
@ -23,7 +27,8 @@ Future<void> showBluetoothPairingRecoveryDialog(BuildContext context) {
|
||||
final content = isIOS
|
||||
? 'The connection opened, then broke while reading the device. This is probably a pairing problem.\n\nGo to Settings, then Bluetooth, then forget this device. After that, come back and connect again.\n\nOr press Open Settings below. From the app settings page, press Back twice to reach Bluetooth settings, then forget this device.'
|
||||
: 'The connection opened, then broke while reading the device. This is probably a pairing problem.\n\nOpen Bluetooth settings, remove/forget this device, then come back and connect again.';
|
||||
final settingsButtonLabel = isIOS ? 'Open Settings' : 'Open Bluetooth settings';
|
||||
final settingsButtonLabel =
|
||||
isIOS ? 'Open Settings' : 'Open Bluetooth settings';
|
||||
|
||||
return showDialog<void>(
|
||||
context: context,
|
||||
|
||||
Reference in New Issue
Block a user