|
|
@ -316,7 +316,7 @@ class ClassicBluetoothService extends GetxService { |
|
|
if (event is Map) { |
|
|
if (event is Map) { |
|
|
final type = event['type'] as String?; |
|
|
final type = event['type'] as String?; |
|
|
|
|
|
|
|
|
if (type == 'stateChanged') { |
|
|
if (type == 'bluetoothStateChanged') { |
|
|
final state = event['state'] as String?; |
|
|
final state = event['state'] as String?; |
|
|
if (state != null) { |
|
|
if (state != null) { |
|
|
_handleBluetoothStateChange(state); |
|
|
_handleBluetoothStateChange(state); |
|
|
@ -353,7 +353,7 @@ class ClassicBluetoothService extends GetxService { |
|
|
|
|
|
|
|
|
/// 处理蓝牙状态变化 |
|
|
/// 处理蓝牙状态变化 |
|
|
void _handleBluetoothStateChange(String state) { |
|
|
void _handleBluetoothStateChange(String state) { |
|
|
Logger.info('蓝牙状态变化: $state'); |
|
|
Logger.info('----蓝牙状态变化: $state'); |
|
|
|
|
|
|
|
|
// 如果蓝牙关闭,清除设备信息 |
|
|
// 如果蓝牙关闭,清除设备信息 |
|
|
if (state == 'off') { |
|
|
if (state == 'off') { |
|
|
|