|
|
@ -1,12 +1,10 @@ |
|
|
import 'dart:convert'; |
|
|
|
|
|
import 'dart:typed_data'; |
|
|
|
|
|
|
|
|
|
|
|
import 'package:app_settings/app_settings.dart'; |
|
|
import 'package:app_settings/app_settings.dart'; |
|
|
import 'package:voitrans/data/models/appconfig_model.dart'; |
|
|
import 'package:voitrans/data/models/appconfig_model.dart'; |
|
|
import '/data/models/appconfig.dart'; |
|
|
import '/data/models/appconfig.dart'; |
|
|
import '/data/models/user_Info.dart'; |
|
|
import '/data/models/user_Info.dart'; |
|
|
import '/data/services/network/api.dart'; |
|
|
import '/data/services/network/api.dart'; |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
import 'dart:async'; |
|
|
import 'dart:async'; |
|
|
import 'package:permission_handler/permission_handler.dart'; |
|
|
import 'package:permission_handler/permission_handler.dart'; |
|
|
@ -16,7 +14,6 @@ import 'dart:io'; |
|
|
import '../../../data/services/bluetooth_manager.dart'; |
|
|
import '../../../data/services/bluetooth_manager.dart'; |
|
|
import '../../../data/services/ble_manager.dart'; |
|
|
import '../../../data/services/ble_manager.dart'; |
|
|
import '../../../core/utils/permission_util.dart'; |
|
|
import '../../../core/utils/permission_util.dart'; |
|
|
import 'package:url_launcher/url_launcher.dart'; |
|
|
|
|
|
|
|
|
|
|
|
/// 配对状态枚举 - 简化版本 |
|
|
/// 配对状态枚举 - 简化版本 |
|
|
enum PairingState { |
|
|
enum PairingState { |
|
|
@ -1028,52 +1025,65 @@ class PairingController extends GetxController { |
|
|
void _showBluetoothGuideDialog() { |
|
|
void _showBluetoothGuideDialog() { |
|
|
Get.dialog( |
|
|
Get.dialog( |
|
|
AlertDialog( |
|
|
AlertDialog( |
|
|
title: Text('需要手动开启蓝牙'), |
|
|
title: Text('bluetoothGuideTitle'.tr), |
|
|
content: Column( |
|
|
content: Column( |
|
|
mainAxisSize: MainAxisSize.min, |
|
|
mainAxisSize: MainAxisSize.min, |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
children: [ |
|
|
children: [ |
|
|
Text('请按照以下步骤操作:'), |
|
|
Text('bluetoothGuideSteps'.tr), |
|
|
SizedBox(height: 16), |
|
|
SizedBox(height: 16.h), |
|
|
Row( |
|
|
Row( |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
children: [ |
|
|
children: [ |
|
|
Text('1. ', style: TextStyle(fontWeight: FontWeight.bold)), |
|
|
Text('1. ', |
|
|
Expanded(child: Text('开启蓝牙:设置 → 蓝牙 → 开启')), |
|
|
style: TextStyle( |
|
|
|
|
|
fontWeight: FontWeight.bold, fontSize: 14.sp)), |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: Text('bluetoothGuideStep1'.tr, |
|
|
|
|
|
style: TextStyle(fontSize: 14.sp))), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
SizedBox(height: 8), |
|
|
SizedBox(height: 8.h), |
|
|
Row( |
|
|
Row( |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
children: [ |
|
|
children: [ |
|
|
Text('2. ', style: TextStyle(fontWeight: FontWeight.bold)), |
|
|
Text('2. ', |
|
|
Expanded(child: Text('连接设备:在"我的设备"中找到您的设备并点击连接')), |
|
|
style: TextStyle( |
|
|
|
|
|
fontWeight: FontWeight.bold, fontSize: 14.sp)), |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: Text('bluetoothGuideStep2'.tr, |
|
|
|
|
|
style: TextStyle(fontSize: 14.sp))), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
SizedBox(height: 8), |
|
|
SizedBox(height: 8.h), |
|
|
Row( |
|
|
Row( |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
children: [ |
|
|
children: [ |
|
|
Text('3. ', style: TextStyle(fontWeight: FontWeight.bold)), |
|
|
Text('3. ', |
|
|
Expanded(child: Text('返回应用继续配对流程')), |
|
|
style: TextStyle( |
|
|
|
|
|
fontWeight: FontWeight.bold, fontSize: 14.sp)), |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: Text('bluetoothGuideStep3'.tr, |
|
|
|
|
|
style: TextStyle(fontSize: 14.sp))), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
SizedBox(height: 16), |
|
|
SizedBox(height: 16.h), |
|
|
Container( |
|
|
Container( |
|
|
padding: EdgeInsets.all(12), |
|
|
padding: EdgeInsets.all(12.w), |
|
|
decoration: BoxDecoration( |
|
|
decoration: BoxDecoration( |
|
|
color: Colors.blue.withOpacity(0.1), |
|
|
color: Colors.blue.withOpacity(0.1), |
|
|
borderRadius: BorderRadius.circular(8), |
|
|
borderRadius: BorderRadius.circular(8.r), |
|
|
border: Border.all(color: Colors.blue.withOpacity(0.3)), |
|
|
border: Border.all(color: Colors.blue.withOpacity(0.3)), |
|
|
), |
|
|
), |
|
|
child: Row( |
|
|
child: Row( |
|
|
children: [ |
|
|
children: [ |
|
|
Icon(Icons.info_outline, color: Colors.blue, size: 20), |
|
|
Icon(Icons.info_outline, color: Colors.blue, size: 20.sp), |
|
|
SizedBox(width: 8), |
|
|
SizedBox(width: 8.w), |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: Text( |
|
|
child: Text( |
|
|
'提示:也可以从控制中心长按蓝牙图标快速进入蓝牙设置', |
|
|
'bluetoothGuideTip'.tr, |
|
|
style: TextStyle(fontSize: 12, color: Colors.blue[700]), |
|
|
style: |
|
|
|
|
|
TextStyle(fontSize: 12.sp, color: Colors.blue[700]), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
], |
|
|
], |
|
|
@ -1084,7 +1094,7 @@ class PairingController extends GetxController { |
|
|
actions: [ |
|
|
actions: [ |
|
|
TextButton( |
|
|
TextButton( |
|
|
onPressed: () => Get.back(), |
|
|
onPressed: () => Get.back(), |
|
|
child: Text('我知道了'), |
|
|
child: Text('iKnow'.tr, style: TextStyle(fontSize: 14.sp)), |
|
|
), |
|
|
), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
|