1、修复安卓低版本手机扫描蓝牙慢、开锁慢的情况
2、修复遥控、掌静脉添加问题
This commit is contained in:
parent
577a056e53
commit
1aa818402b
BIN
ios/.DS_Store
vendored
BIN
ios/.DS_Store
vendored
Binary file not shown.
24
ios/Podfile.lock
Executable file → Normal file
24
ios/Podfile.lock
Executable file → Normal file
@ -116,13 +116,13 @@ PODS:
|
||||
- image_picker_ios (0.0.1):
|
||||
- Flutter
|
||||
- ios-voice-processor (1.1.0)
|
||||
- JCore (4.4.0)
|
||||
- JPush (5.2.0):
|
||||
- JCore (4.6.2)
|
||||
- JPush (5.3.0):
|
||||
- JCore (>= 2.0.0)
|
||||
- jpush_flutter (0.0.2):
|
||||
- Flutter
|
||||
- JCore (= 4.4.0)
|
||||
- JPush (= 5.2.0)
|
||||
- JCore (>= 4.6.2)
|
||||
- JPush (= 5.3.0)
|
||||
- just_audio (0.0.1):
|
||||
- Flutter
|
||||
- network_info_plus (0.0.1):
|
||||
@ -323,7 +323,7 @@ SPEC CHECKSUMS:
|
||||
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
||||
Bugly: 217ac2ce5f0f2626d43dbaa4f70764c953a26a31
|
||||
camera_avfoundation: 759172d1a77ae7be0de08fc104cfb79738b8a59e
|
||||
camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4
|
||||
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
|
||||
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
|
||||
DKImagePickerController: 0a24ebfe7b48beeb74c27531540aaa2cc1dac6cf
|
||||
@ -337,16 +337,16 @@ SPEC CHECKSUMS:
|
||||
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
||||
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
|
||||
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
|
||||
fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
|
||||
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
|
||||
fluwx: c18fd6c16b03a2187cd07d6e48e32a7801962849
|
||||
google_maps_flutter_ios: f135b968a67c05679e0a53538e900b5c174b0d99
|
||||
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
|
||||
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
|
||||
image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18
|
||||
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
|
||||
ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1
|
||||
JCore: 05f0f3489672ea3fa55338bae4866224bc092b1f
|
||||
JPush: 76668b765fcfd7c15f86b05ca0e5cdc01945ce23
|
||||
jpush_flutter: 1f436f1a02db5c5ef9e9b42378f557096ccd328b
|
||||
JCore: 024c73b04e110b496e93d8c127ea9cd1ed934e4c
|
||||
JPush: b71f497a3c1b825c7843fd97f290b05d5cd75f2e
|
||||
jpush_flutter: c87be254790933c0363684169ef9d3d279a5adc5
|
||||
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
|
||||
network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f
|
||||
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
|
||||
@ -362,9 +362,9 @@ SPEC CHECKSUMS:
|
||||
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
|
||||
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
||||
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
|
||||
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
|
||||
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
|
||||
WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f
|
||||
|
||||
PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc
|
||||
|
||||
COCOAPODS: 1.14.3
|
||||
COCOAPODS: 1.15.2
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
@ -10,7 +11,6 @@ import 'io_tool/io_model.dart';
|
||||
import 'io_tool/io_tool.dart';
|
||||
import 'io_tool/manager_event_bus.dart';
|
||||
import 'reciver_data.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
|
||||
//连接状态回调
|
||||
typedef ConnectStateCallBack = Function(
|
||||
@ -62,7 +62,7 @@ class BlueManage {
|
||||
BluetoothConnectionState? bluetoothConnectionState =
|
||||
BluetoothConnectionState.disconnected;
|
||||
|
||||
BluetoothAdapterState? _adapterState = BluetoothAdapterState.unknown;
|
||||
BluetoothAdapterState? _adapterState = BluetoothAdapterState.on;
|
||||
StreamSubscription<BluetoothAdapterState>? _adapterStateStateSubscription;
|
||||
|
||||
// 听上报来的数据,参数来自前面扫描到的结果
|
||||
@ -99,6 +99,7 @@ class BlueManage {
|
||||
void _initAdapterStateStateSubscription() {
|
||||
_adapterStateStateSubscription ??=
|
||||
FlutterBluePlus.adapterState.listen((BluetoothAdapterState state) {
|
||||
AppLog.log('蓝牙状态:$state');
|
||||
_adapterState = state;
|
||||
});
|
||||
}
|
||||
@ -144,6 +145,7 @@ class BlueManage {
|
||||
final DateTime start = DateTime.now();
|
||||
FlutterBluePlus.isSupported.then((bool isAvailable) async {
|
||||
if (isAvailable) {
|
||||
// AppLog.log('startScanSingle 蓝牙状态 系统蓝牙状态:$_adapterState 蓝牙连接状态:$bluetoothConnectionState');
|
||||
if (_adapterState == BluetoothAdapterState.on) {
|
||||
try {
|
||||
//android 扫描比较慢,取样只要 3 分之一
|
||||
@ -221,13 +223,14 @@ class BlueManage {
|
||||
{List<Guid>? idList}) async {
|
||||
FlutterBluePlus.isSupported.then((bool isAvailable) async {
|
||||
if (isAvailable) {
|
||||
// AppLog.log('startScan 蓝牙状态 系统蓝牙状态:$_adapterState 蓝牙连接状态:$bluetoothConnectionState');
|
||||
if (_adapterState == BluetoothAdapterState.on) {
|
||||
try {
|
||||
FlutterBluePlus.startScan(timeout: Duration(seconds: timeout));
|
||||
final StreamSubscription<List<ScanResult>> subscription =
|
||||
FlutterBluePlus.scanResults.listen((List<ScanResult> results) {
|
||||
final StreamSubscription<List<ScanResult>> subscription = FlutterBluePlus.scanResults.listen((List<ScanResult> results) {
|
||||
scanDevices.clear();
|
||||
for (final ScanResult scanResult in results) {
|
||||
// AppLog.log('扫描到的设备:${scanResult.device.platformName} ${scanResult.advertisementData.advName} ${scanResult.rssi}');
|
||||
// 判断名字为空的直接剔除
|
||||
if (((scanResult.advertisementData.serviceUuids.isNotEmpty
|
||||
? scanResult.advertisementData.serviceUuids[0]
|
||||
|
||||
@ -17,7 +17,7 @@ class AddICCardPage extends StatefulWidget {
|
||||
State<AddICCardPage> createState() => _AddICCardPageState();
|
||||
}
|
||||
|
||||
class _AddICCardPageState extends State<AddICCardPage> with RouteAware {
|
||||
class _AddICCardPageState extends State<AddICCardPage> with RouteAware {
|
||||
final AddICCardLogic logic = Get.put(AddICCardLogic());
|
||||
final AddICCardState state = Get.find<AddICCardLogic>().state;
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ import '../../../../../tools/dateTool.dart';
|
||||
import '../../../../../tools/submitBtn.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
import '../../../../lockMian/lockMain/lockMain_logic.dart';
|
||||
import '../../lockSet/lockSetInfo_entity.dart';
|
||||
import 'uploadElectricQuantity_logic.dart';
|
||||
|
||||
@ -56,7 +57,7 @@ class _UploadElectricQuantityPageState extends State<UploadElectricQuantityPage>
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${"电池1".tr}:${TranslationLoader.lanKeys!.electricQuantity!.tr}:${state.lockBasicInfo.value.electricQuantity ?? ""}%",
|
||||
"${"电池1".tr}${TranslationLoader.lanKeys!.electricQuantity!.tr}:${state.lockBasicInfo.value.electricQuantity ?? ""}%",
|
||||
style: TextStyle(fontSize: 20.sp),
|
||||
)),
|
||||
],
|
||||
@ -68,7 +69,7 @@ class _UploadElectricQuantityPageState extends State<UploadElectricQuantityPage>
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${"电池2".tr}:${TranslationLoader.lanKeys!.electricQuantity!.tr}:${state.lockBasicInfo.value.electricQuantityStandby ?? ""}%",
|
||||
"${"电池2".tr}${TranslationLoader.lanKeys!.electricQuantity!.tr}:${state.lockBasicInfo.value.electricQuantityStandby ?? ""}%",
|
||||
style: TextStyle(fontSize: 20.sp),
|
||||
)),
|
||||
],
|
||||
@ -80,7 +81,7 @@ class _UploadElectricQuantityPageState extends State<UploadElectricQuantityPage>
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${"电量更新时间".tr}:${DateTool().dateToYMDHNString(state.uploadElectricQuantityDate.value.toString())}",
|
||||
"${"电量更新时间".tr}:${state.uploadElectricQuantityDate.value == 0 ? "-" : DateTool().dateToYMDHNString(state.uploadElectricQuantityDate.value.toString())}",
|
||||
style: TextStyle(fontSize: 20.sp),
|
||||
)),
|
||||
],
|
||||
@ -94,7 +95,11 @@ class _UploadElectricQuantityPageState extends State<UploadElectricQuantityPage>
|
||||
fontSize: 32.sp,
|
||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||
onClick: () {
|
||||
onClick: () async {
|
||||
final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false;
|
||||
if (!isNetWork) {
|
||||
return;
|
||||
}
|
||||
logic.getStarLockStatus();
|
||||
}),
|
||||
],
|
||||
|
||||
@ -9,6 +9,7 @@ import '../../../../tools/appRouteObserver.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
import '../../../../translations/trans_lib.dart';
|
||||
import '../../../lockMian/lockMain/lockMain_logic.dart';
|
||||
import 'burglarAlarm_logic.dart';
|
||||
|
||||
class BurglarAlarmPage extends StatefulWidget {
|
||||
@ -52,7 +53,7 @@ class _BurglarAlarmPageState extends State<BurglarAlarmPage> with RouteAware{
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${state.burglarAlarmEnable.value == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr}",
|
||||
'${TranslationLoader.lanKeys!.currentMode!.tr} : ${state.burglarAlarmEnable.value == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr}',
|
||||
style:
|
||||
TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w600),
|
||||
)),
|
||||
@ -67,8 +68,12 @@ class _BurglarAlarmPageState extends State<BurglarAlarmPage> with RouteAware{
|
||||
fontSize: 32.sp,
|
||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||
onClick: () {
|
||||
logic.sendBurglarAlarm();
|
||||
onClick: () async {
|
||||
final bool isNetWork = await LockMainLogic.to()?.judgeTheNetwork() ?? false;
|
||||
if (!isNetWork) {
|
||||
return;
|
||||
}
|
||||
logic.sendBurglarAlarm();
|
||||
})),
|
||||
],
|
||||
),
|
||||
|
||||
@ -123,7 +123,7 @@ class AddPalmLogic extends BaseGetXController {
|
||||
break;
|
||||
case 0xFC:
|
||||
// 指纹已满
|
||||
showToast('锁上面添加卡已满'.tr);
|
||||
showToast('锁上面添加掌静脉已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFB:
|
||||
@ -192,7 +192,7 @@ class AddPalmLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 取消添加指纹
|
||||
Future<void> senderCancelAddCardCommand() async {
|
||||
Future<void> senderCancelAddPalmCommand() async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
|
||||
@ -7,6 +7,7 @@ import 'package:star_lock/main/lockDetail/palm/addPalm/addPalm_state.dart';
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/submitBtn.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../tools/appRouteObserver.dart';
|
||||
|
||||
class AddPalmPage extends StatefulWidget {
|
||||
const AddPalmPage({Key? key}) : super(key: key);
|
||||
@ -15,7 +16,7 @@ class AddPalmPage extends StatefulWidget {
|
||||
State<AddPalmPage> createState() => _AddPalmPageState();
|
||||
}
|
||||
|
||||
class _AddPalmPageState extends State<AddPalmPage> {
|
||||
class _AddPalmPageState extends State<AddPalmPage> with RouteAware{
|
||||
final AddPalmLogic logic = Get.put(AddPalmLogic());
|
||||
final AddPalmState state = Get.find<AddPalmLogic>().state;
|
||||
|
||||
@ -24,7 +25,7 @@ class _AddPalmPageState extends State<AddPalmPage> {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: '添加手掌',
|
||||
barTitle: '添加掌静脉',
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView(
|
||||
@ -100,4 +101,54 @@ class _AddPalmPageState extends State<AddPalmPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
|
||||
/// 路由订阅
|
||||
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
/// 取消路由订阅
|
||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 从上级界面进入 当前界面即将出现
|
||||
@override
|
||||
void didPush() {
|
||||
super.didPush();
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 返回上一个界面 当前界面即将消失
|
||||
@override
|
||||
void didPop() {
|
||||
super.didPop();
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
state.ifCurrentScreen.value = false;
|
||||
|
||||
if(state.ifAddState.value){
|
||||
logic.senderCancelAddPalmCommand();
|
||||
}
|
||||
}
|
||||
|
||||
/// 从下级返回 当前界面即将出现
|
||||
@override
|
||||
void didPopNext() {
|
||||
super.didPopNext();
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 进入下级界面 当前界面即将消失
|
||||
@override
|
||||
void didPushNext() {
|
||||
super.didPushNext();
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,14 +34,14 @@ class _PalmDetailPageState extends State<PalmDetailPage> with RouteAware {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: '手掌详情',
|
||||
barTitle: '掌静脉详情',
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
body: ListView(
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: '手掌号',
|
||||
leftTitel: '掌静脉号',
|
||||
rightTitle: state.typeNumber.value,
|
||||
isHaveDirection: false,
|
||||
isHaveLine: true)),
|
||||
|
||||
@ -122,7 +122,7 @@ class AddRemoteControlLogic extends BaseGetXController{
|
||||
break;
|
||||
case 0xFC:
|
||||
// 遥控已满
|
||||
showToast('锁上面添加卡已满'.tr);
|
||||
showToast('锁上面遥控已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFB:
|
||||
|
||||
@ -4,6 +4,13 @@ import 'package:get/get.dart';
|
||||
import '../minePersonInfoPage/minePersonInfo_entity.dart';
|
||||
|
||||
class MinePersonInfoEditNamePageState {
|
||||
|
||||
MinePersonInfoEditNamePageState() {
|
||||
Map map = Get.arguments;
|
||||
mineInfoData.value = map['mineInfoData'];
|
||||
nickNameController.text = mineInfoData.value.nickname ?? '';
|
||||
inputNickName.value = mineInfoData.value.nickname ?? '';
|
||||
}
|
||||
final mineInfoData = MinePersonInfoData().obs;
|
||||
|
||||
final TextEditingController nickNameController = TextEditingController();
|
||||
@ -11,11 +18,4 @@ class MinePersonInfoEditNamePageState {
|
||||
final inputNickName = ''.obs;
|
||||
var canSub = false.obs;
|
||||
bool get nickNameIsOK => inputNickName.value.isNotEmpty;
|
||||
|
||||
MinePersonInfoEditNamePageState() {
|
||||
Map map = Get.arguments;
|
||||
mineInfoData.value = map["mineInfoData"];
|
||||
nickNameController.text = mineInfoData.value.nickname!;
|
||||
inputNickName.value = mineInfoData.value.nickname!;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user