feat:修改开锁按钮 ui
This commit is contained in:
parent
c40a95641a
commit
6f97b6812e
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);
|
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
|
||||||
|
|
||||||
bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
|
bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
|
||||||
if(!ifHaveKey){
|
if (!ifHaveKey) {
|
||||||
var saveTokenList = changeIntListToStringList([0, 0, 0, 0]);
|
var saveTokenList = changeIntListToStringList([0, 0, 0, 0]);
|
||||||
Storage.setStringList(saveBlueToken, saveTokenList);
|
Storage.setStringList(saveBlueToken, saveTokenList);
|
||||||
}
|
}
|
||||||
@ -232,79 +232,78 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Obx(() {
|
GestureDetector(
|
||||||
return GestureDetector(
|
onTap: state.openDoorBtnisUneable.value == true
|
||||||
onTap: state.openDoorBtnisUneable.value == true
|
? () {
|
||||||
? () {
|
setState(() {
|
||||||
setState(() {
|
startOpenLock();
|
||||||
startOpenLock();
|
});
|
||||||
});
|
}
|
||||||
}
|
: null,
|
||||||
: null,
|
onLongPressStart: state.openDoorBtnisUneable.value == true
|
||||||
onLongPressStart: state.openDoorBtnisUneable.value == true
|
? (details) {
|
||||||
? (details) {
|
setState(() {
|
||||||
setState(() {
|
startUnLock();
|
||||||
startUnLock();
|
});
|
||||||
});
|
}
|
||||||
}
|
: null,
|
||||||
: null,
|
child: Container(
|
||||||
child: Container(
|
width: 100.r,
|
||||||
decoration: BoxDecoration(
|
height: 100.r,
|
||||||
color: Colors.white.withOpacity(0.9),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(100.w),
|
color: Colors.white.withOpacity(0.9),
|
||||||
boxShadow: [
|
borderRadius: BorderRadius.circular(100.w),
|
||||||
BoxShadow(
|
boxShadow: [
|
||||||
color: Colors.black.withOpacity(0.3),
|
BoxShadow(
|
||||||
offset: Offset(0, 0),
|
color: Colors.black.withOpacity(0.3),
|
||||||
blurRadius: 10.r,
|
offset: Offset(0, 0),
|
||||||
spreadRadius: 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,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
state.openDoorBtnisUneable.value == false
|
]),
|
||||||
? Positioned(
|
margin: EdgeInsets.only(left: 35.w, bottom: 15.h),
|
||||||
child: FlavorsImg(
|
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(
|
child: Image.asset(
|
||||||
'images/main/icon_main_openLockBtn_grey.png',
|
'images/icon_circle_dotted.png',
|
||||||
width: 96.r,
|
width: 88.r,
|
||||||
height: 96.r,
|
height: 88.r,
|
||||||
),
|
color: state.isOpenPassageMode.value == 1
|
||||||
),
|
? Colors.red
|
||||||
)
|
: AppColors.mainColor,
|
||||||
: 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,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
}),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 15.w, right: 00.w, bottom: 15.h),
|
padding: EdgeInsets.only(left: 15.w, right: 00.w, bottom: 15.h),
|
||||||
child: Row(
|
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(
|
Widget buildRotationTransition(
|
||||||
{required double width, required double height}) {
|
{required double width, required double height}) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user