Merge branch 'master_hyx'
This commit is contained in:
commit
00f1528854
BIN
star_lock/images/icon_circle_dotted.png
Normal file
BIN
star_lock/images/icon_circle_dotted.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
star_lock/images/icon_lock_err.png
Normal file
BIN
star_lock/images/icon_lock_err.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
BIN
star_lock/images/icon_lock_fill.png
Normal file
BIN
star_lock/images/icon_lock_fill.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
@ -127,7 +127,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
|
||||
|
||||
bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
|
||||
if(!ifHaveKey){
|
||||
if (!ifHaveKey) {
|
||||
var saveTokenList = changeIntListToStringList([0, 0, 0, 0]);
|
||||
Storage.setStringList(saveBlueToken, saveTokenList);
|
||||
}
|
||||
@ -232,79 +232,78 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Spacer(),
|
||||
Obx(() {
|
||||
return GestureDetector(
|
||||
onTap: state.openDoorBtnisUneable.value == true
|
||||
? () {
|
||||
setState(() {
|
||||
startOpenLock();
|
||||
});
|
||||
}
|
||||
: null,
|
||||
onLongPressStart: state.openDoorBtnisUneable.value == true
|
||||
? (details) {
|
||||
setState(() {
|
||||
startUnLock();
|
||||
});
|
||||
}
|
||||
: null,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.9),
|
||||
borderRadius: BorderRadius.circular(100.w),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
offset: Offset(0, 0),
|
||||
blurRadius: 10.r,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
]),
|
||||
margin: EdgeInsets.only(left: 35.w, bottom: 15.h),
|
||||
child: Stack(
|
||||
children: [
|
||||
FlavorsImg(
|
||||
child: Image.asset(
|
||||
state.openDoorBtnisUneable.value == false
|
||||
? 'images/main/icon_main_openLockBtn_grey.png'
|
||||
: (state.isOpenPassageMode.value == 1
|
||||
? 'images/main/icon_main_normallyOpenMode_center.png'
|
||||
: 'images/main/icon_main_openLockBtn_center.png'),
|
||||
width: 96.r,
|
||||
height: 96.r,
|
||||
// color: AppColors.primaryTopColor,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: state.openDoorBtnisUneable.value == true
|
||||
? () {
|
||||
setState(() {
|
||||
startOpenLock();
|
||||
});
|
||||
}
|
||||
: null,
|
||||
onLongPressStart: state.openDoorBtnisUneable.value == true
|
||||
? (details) {
|
||||
setState(() {
|
||||
startUnLock();
|
||||
});
|
||||
}
|
||||
: null,
|
||||
child: Container(
|
||||
width: 100.r,
|
||||
height: 100.r,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.9),
|
||||
borderRadius: BorderRadius.circular(100.w),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
offset: Offset(0, 0),
|
||||
blurRadius: 10.r,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
state.openDoorBtnisUneable.value == false
|
||||
? Positioned(
|
||||
child: FlavorsImg(
|
||||
]),
|
||||
margin: EdgeInsets.only(left: 35.w, bottom: 15.h),
|
||||
child: Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: [
|
||||
state.openDoorBtnisUneable.value == false
|
||||
? Icon(
|
||||
Icons.bluetooth_searching,
|
||||
size: 48.r,
|
||||
color: AppColors.mainColor,
|
||||
)
|
||||
: Image.asset(
|
||||
state.isOpenPassageMode.value == 1
|
||||
? 'images/icon_lock_err.png'
|
||||
: 'images/icon_lock_fill.png',
|
||||
width: 38.r,
|
||||
height: 38.r,
|
||||
color: AppColors.mainColor,
|
||||
),
|
||||
state.openDoorBtnisUneable.value == false
|
||||
? Positioned(
|
||||
child: Icon(
|
||||
Icons.bluetooth_searching,
|
||||
size: 96.r,
|
||||
),
|
||||
)
|
||||
: state.openLockBtnState.value == 1
|
||||
? xhjBuildRotationTransition(
|
||||
width: 88.r,
|
||||
height: 88.r,
|
||||
)
|
||||
: Positioned(
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_openLockBtn_grey.png',
|
||||
width: 96.r,
|
||||
height: 96.r,
|
||||
),
|
||||
),
|
||||
)
|
||||
: state.openLockBtnState.value == 1
|
||||
? buildRotationTransition(
|
||||
width: 96.r,
|
||||
height: 96.r,
|
||||
)
|
||||
: Positioned(
|
||||
child: FlavorsImg(
|
||||
child: Image.asset(
|
||||
state.isOpenPassageMode.value == 1
|
||||
? 'images/main/icon_main_normallyOpenMode_circle.png'
|
||||
: 'images/main/icon_main_openLockBtn_circle.png',
|
||||
width: 96.r,
|
||||
height: 96.r,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
'images/icon_circle_dotted.png',
|
||||
width: 88.r,
|
||||
height: 88.r,
|
||||
color: state.isOpenPassageMode.value == 1
|
||||
? Colors.red
|
||||
: AppColors.mainColor,
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 15.w, right: 00.w, bottom: 15.h),
|
||||
child: Row(
|
||||
@ -735,6 +734,28 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
);
|
||||
}
|
||||
|
||||
//旋转动画
|
||||
Widget xhjBuildRotationTransition(
|
||||
{required double width, required double height}) {
|
||||
return Positioned(
|
||||
child: RotationTransition(
|
||||
//设置动画的旋转中心
|
||||
alignment: Alignment.center,
|
||||
//动画控制器
|
||||
turns: state.animationController!,
|
||||
//将要执行动画的子view
|
||||
child: Image.asset(
|
||||
'images/icon_circle_dotted.png',
|
||||
width: width,
|
||||
height: height,
|
||||
color: state.isOpenPassageMode.value == 1
|
||||
? Colors.red
|
||||
: AppColors.mainColor,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
//旋转动画
|
||||
Widget buildRotationTransition(
|
||||
{required double width, required double height}) {
|
||||
|
||||
@ -161,24 +161,52 @@ class LockEscalationLogic extends BaseGetXController {
|
||||
|
||||
// 检查文件头
|
||||
Future<Map?> getHeadFile(Uint8List data) async {
|
||||
if (data.length <= 16) {
|
||||
showToast('错误D固件,请选择正确的文件');
|
||||
return null;
|
||||
}
|
||||
// 检查文件头
|
||||
String header = utf8.decode(data.sublist(0, 12));
|
||||
String header;
|
||||
try {
|
||||
header = utf8.decode(data.sublist(0, 12));
|
||||
} catch (e) {
|
||||
showToast('非SYD固件,请选择正确的文件');
|
||||
return null;
|
||||
}
|
||||
if (header != 'SYD-BIN-DATA') {
|
||||
showToast('非SYD固件,请选择正确的文件');
|
||||
return null;
|
||||
}
|
||||
// 解析元数据长度
|
||||
Uint8List metaLenList = data.sublist(12, 16);
|
||||
int metaLen = ByteData.sublistView(metaLenList).getUint32(0);
|
||||
Uint8List metaLenList;
|
||||
int metaLen;
|
||||
try {
|
||||
metaLenList = data.sublist(12, 16);
|
||||
metaLen = ByteData.sublistView(metaLenList).getUint32(0);
|
||||
} catch (e) {
|
||||
showToast('文件校验失败 0x01');
|
||||
return null;
|
||||
}
|
||||
if (metaLen < 2 || metaLen > 10240) {
|
||||
showToast('文件校验失败 0x01');
|
||||
return null;
|
||||
}
|
||||
// 读取和解析元数据
|
||||
Uint8List metaStrList = data.sublist(16, 16 + metaLen);
|
||||
String metaStr = utf8.decode(metaStrList);
|
||||
Uint8List metaStrList;
|
||||
String metaStr;
|
||||
try {
|
||||
metaStrList = data.sublist(16, 16 + metaLen);
|
||||
metaStr = utf8.decode(metaStrList);
|
||||
} catch (e) {
|
||||
showToast('解析元数据失败,请选择正确的文件');
|
||||
return null;
|
||||
}
|
||||
AppLog.log(metaStr);
|
||||
var meta = jsonDecode(metaStr);
|
||||
if (meta is! Map) {
|
||||
showToast('解析元数据失败,请选择正确的文件');
|
||||
return null;
|
||||
}
|
||||
return meta..['metaLen'] = metaLen;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user