Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
This commit is contained in:
commit
f3a06d13c7
@ -56,19 +56,6 @@ android {
|
|||||||
keyAlias = 'starlock'
|
keyAlias = 'starlock'
|
||||||
keyPassword '123456'
|
keyPassword '123456'
|
||||||
}
|
}
|
||||||
// 下面的local、pre、sky、xhj 都是自定义变量,自身不起任何作用,而是看哪里引用了它们
|
|
||||||
local {
|
|
||||||
storeFile file("starlock.keystore")
|
|
||||||
storePassword '123456'
|
|
||||||
keyAlias = 'starlock'
|
|
||||||
keyPassword '123456'
|
|
||||||
}
|
|
||||||
pre {
|
|
||||||
storeFile file("starlock.keystore")
|
|
||||||
storePassword '123456'
|
|
||||||
keyAlias = 'starlock'
|
|
||||||
keyPassword '123456'
|
|
||||||
}
|
|
||||||
sky {
|
sky {
|
||||||
// CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
|
// CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
|
||||||
storeFile file("sky.jks")
|
storeFile file("sky.jks")
|
||||||
@ -91,21 +78,21 @@ android {
|
|||||||
local {
|
local {
|
||||||
dimension "flavor-type"
|
dimension "flavor-type"
|
||||||
applicationId "com.starlock.lock.local"
|
applicationId "com.starlock.lock.local"
|
||||||
signingConfig signingConfigs.pre
|
signingConfig signingConfigs.debug
|
||||||
resValue "string", "app_name", "星锁-local"
|
resValue "string", "app_name", "星锁-local"
|
||||||
manifestPlaceholders.JPUSH_PKGNAME = "com.starlock.lock.local"
|
manifestPlaceholders.JPUSH_PKGNAME = "com.starlock.lock.local"
|
||||||
}
|
}
|
||||||
dev {
|
dev {
|
||||||
dimension "flavor-type"
|
dimension "flavor-type"
|
||||||
applicationId "com.starlock.lock.dev"
|
applicationId "com.starlock.lock.dev"
|
||||||
signingConfig signingConfigs.pre
|
signingConfig signingConfigs.debug
|
||||||
resValue "string", "app_name", "星锁-dev"
|
resValue "string", "app_name", "星锁-dev"
|
||||||
manifestPlaceholders.JPUSH_PKGNAME = "com.starlock.lock.dev"
|
manifestPlaceholders.JPUSH_PKGNAME = "com.starlock.lock.dev"
|
||||||
}
|
}
|
||||||
pre {
|
pre {
|
||||||
dimension "flavor-type"
|
dimension "flavor-type"
|
||||||
applicationId "com.starlock.lock.pre"
|
applicationId "com.starlock.lock.pre"
|
||||||
signingConfig signingConfigs.pre
|
signingConfig signingConfigs.debug
|
||||||
resValue "string", "app_name", "星锁"
|
resValue "string", "app_name", "星锁"
|
||||||
manifestPlaceholders.JPUSH_PKGNAME = "com.starlock.lock.pre"
|
manifestPlaceholders.JPUSH_PKGNAME = "com.starlock.lock.pre"
|
||||||
}
|
}
|
||||||
@ -202,9 +189,9 @@ android {
|
|||||||
// 真实的解决办法
|
// 真实的解决办法
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
shrinkResources false
|
shrinkResources false
|
||||||
productFlavors.local.signingConfig signingConfigs.pre
|
productFlavors.local.signingConfig signingConfigs.debug
|
||||||
productFlavors.dev.signingConfig signingConfigs.pre
|
productFlavors.dev.signingConfig signingConfigs.debug
|
||||||
productFlavors.pre.signingConfig signingConfigs.pre
|
productFlavors.pre.signingConfig signingConfigs.debug
|
||||||
productFlavors.sky.signingConfig signingConfigs.sky
|
productFlavors.sky.signingConfig signingConfigs.sky
|
||||||
productFlavors.xhj.signingConfig signingConfigs.xhj
|
productFlavors.xhj.signingConfig signingConfigs.xhj
|
||||||
}
|
}
|
||||||
|
|||||||
@ -765,5 +765,9 @@
|
|||||||
"自动亮屏":"Automatic bright screen",
|
"自动亮屏":"Automatic bright screen",
|
||||||
"亮屏持续时间":"Screen on time",
|
"亮屏持续时间":"Screen on time",
|
||||||
"逗留警告":"Stay warning",
|
"逗留警告":"Stay warning",
|
||||||
"异常警告":"Abnormal warning"
|
"异常警告":"Abnormal warning",
|
||||||
|
|
||||||
|
"关锁":"关锁",
|
||||||
|
"功能":"功能",
|
||||||
|
"配件":"配件"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -764,5 +764,8 @@
|
|||||||
"自动亮屏":"自动亮屏",
|
"自动亮屏":"自动亮屏",
|
||||||
"亮屏持续时间":"亮屏持续时间",
|
"亮屏持续时间":"亮屏持续时间",
|
||||||
"逗留警告":"逗留警告",
|
"逗留警告":"逗留警告",
|
||||||
"异常警告":"异常警告"
|
"异常警告":"异常警告",
|
||||||
|
"关锁":"Close Lock",
|
||||||
|
"功能":"Function",
|
||||||
|
"配件":"Parts"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -767,5 +767,8 @@
|
|||||||
"自动亮屏":"自动亮屏",
|
"自动亮屏":"自动亮屏",
|
||||||
"亮屏持续时间":"亮屏持续时间",
|
"亮屏持续时间":"亮屏持续时间",
|
||||||
"逗留警告":"逗留警告",
|
"逗留警告":"逗留警告",
|
||||||
"异常警告":"异常警告"
|
"异常警告":"异常警告",
|
||||||
|
"关锁":"关锁",
|
||||||
|
"功能":"功能",
|
||||||
|
"配件":"配件"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,7 +141,56 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
state.widgetContext = context;
|
state.widgetContext = context;
|
||||||
loadData();
|
loadData();
|
||||||
|
return F.sw(defaultCall: () => skWidget(), xhjCall: () => xhjWidget());
|
||||||
|
}
|
||||||
|
|
||||||
|
//鑫泓佳布局
|
||||||
|
Widget xhjWidget() {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Obx(() {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 45.h,
|
||||||
|
),
|
||||||
|
infoView(),
|
||||||
|
SizedBox(
|
||||||
|
height: 35.h,
|
||||||
|
),
|
||||||
|
labelGridView('功能'.tr, getBottomWidget()),
|
||||||
|
labelListView('配件'.tr, getAttachmentWidget()),
|
||||||
|
SizedBox(
|
||||||
|
height: 45.h,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 52.w, right: 52.w),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
buttonView('关锁'.tr, () {
|
||||||
|
if (state.openDoorBtnisUneable.value == true) {
|
||||||
|
startUnLock();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
buttonView('开锁'.tr, () {
|
||||||
|
if (state.openDoorBtnisUneable.value == true) {
|
||||||
|
startOpenLock();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//斯凯布局
|
||||||
|
Widget skWidget() {
|
||||||
return ListView(
|
return ListView(
|
||||||
children: [
|
children: [
|
||||||
Visibility(
|
Visibility(
|
||||||
@ -195,12 +244,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
child: PageView(
|
child: PageView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
controller: state.pageController,
|
controller: state.pageController,
|
||||||
// child: Row(
|
|
||||||
children: [
|
children: [
|
||||||
Obx(() => bottomWidget()),
|
Obx(() => bottomWidget()),
|
||||||
attachmentWidget(),
|
attachmentWidget(),
|
||||||
],
|
],
|
||||||
// ),
|
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
@ -227,6 +274,212 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//操作锁按钮
|
||||||
|
Widget buttonView(String text, VoidCallback? onPressed) {
|
||||||
|
bool openLockBtnState = state.openLockBtnState.value != 0;
|
||||||
|
return ElevatedButton(
|
||||||
|
onPressed: openLockBtnState ? null : onPressed,
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: openLockBtnState
|
||||||
|
? AppColors.mainBackgroundColor
|
||||||
|
: AppColors.mainColor,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
// 设置按钮的形状
|
||||||
|
borderRadius: BorderRadius.circular(8), // 圆角的大小
|
||||||
|
)),
|
||||||
|
child: SizedBox(
|
||||||
|
height: 0.12.sh,
|
||||||
|
width: 0.12.sh,
|
||||||
|
child: Center(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
text,
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
openLockBtnState ? AppColors.mainColor : Colors.white),
|
||||||
|
),
|
||||||
|
if (openLockBtnState)
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 15.w),
|
||||||
|
width: 15.r,
|
||||||
|
height: 15.r,
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
strokeWidth: 3.5,
|
||||||
|
color: AppColors.mainColor,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget infoView() {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(left: 35.w, right: 10.w),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
state.lockAlias.value,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 28.sp,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: state.isOpenPassageMode.value == 1
|
||||||
|
? AppColors.openPassageModeColor
|
||||||
|
: AppColors.darkGrayTextColor),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 15.h,
|
||||||
|
),
|
||||||
|
adminInfoView(center: false, max: false),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
FlavorsImg(
|
||||||
|
child: Image.asset(
|
||||||
|
showElectricIcon(state.electricQuantity.value),
|
||||||
|
width: 30.w,
|
||||||
|
height: 24.w),
|
||||||
|
),
|
||||||
|
SizedBox(width: 2.w),
|
||||||
|
Text("${state.electricQuantity.value}%",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
|
||||||
|
SizedBox(width: 2.w),
|
||||||
|
FlavorsImg(
|
||||||
|
child: Icon(
|
||||||
|
Icons.info, // 使用内置的 warning 图标,它是一个叹号
|
||||||
|
color: AppColors.mainColor, // 设置图标颜色为红色
|
||||||
|
size: 25.w, // 设置图标大小为 30
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.w),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 15.h,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
FlavorsImg(
|
||||||
|
child: Image.asset(
|
||||||
|
showElectricIcon(state.electricQuantity.value),
|
||||||
|
width: 30.w,
|
||||||
|
height: 24.w),
|
||||||
|
),
|
||||||
|
SizedBox(width: 2.w),
|
||||||
|
Text("--%",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
|
||||||
|
SizedBox(width: 2.w),
|
||||||
|
FlavorsImg(
|
||||||
|
child: Icon(
|
||||||
|
Icons.info, // 使用内置的 warning 图标,它是一个叹号
|
||||||
|
color: AppColors.mainColor, // 设置图标颜色为红色
|
||||||
|
size: 25.w, // 设置图标大小为 30
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.w),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//带标签的 GridView 布局
|
||||||
|
Widget labelGridView(String text, List<Widget> children) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 40.w,
|
||||||
|
top: 20.h,
|
||||||
|
bottom: 20.h,
|
||||||
|
),
|
||||||
|
child: Text(text))),
|
||||||
|
SizedBox(
|
||||||
|
height: 200.h,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: GridView.count(
|
||||||
|
padding: EdgeInsets.only(left: 15.w, right: 15.w),
|
||||||
|
crossAxisCount: 2,
|
||||||
|
childAspectRatio: 0.7,
|
||||||
|
crossAxisSpacing: 25.h,
|
||||||
|
mainAxisSpacing: 25.w,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: children),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 0.w, right: 4.w),
|
||||||
|
child: const Icon(Icons.arrow_forward_ios_rounded),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//带标签的 ListView 布局
|
||||||
|
Widget labelListView(String text, List<Widget> children) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 40.w,
|
||||||
|
top: 20.h,
|
||||||
|
bottom: 20.h,
|
||||||
|
),
|
||||||
|
child: Text(text))),
|
||||||
|
SizedBox(
|
||||||
|
height: 100.h,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: GridView.count(
|
||||||
|
padding: EdgeInsets.only(left: 15.w, right: 15.w),
|
||||||
|
crossAxisCount: 1,
|
||||||
|
childAspectRatio: 0.7,
|
||||||
|
crossAxisSpacing: 25.h,
|
||||||
|
mainAxisSpacing: 25.w,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: children),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 0.w, right: 4.w),
|
||||||
|
child: Icon(Icons.arrow_forward_ios_rounded),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget topWidget() {
|
Widget topWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
@ -421,10 +674,12 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget adminInfoView({bool center = true, bool add = false}) {
|
Widget adminInfoView(
|
||||||
|
{bool center = true, bool max = true, bool add = false}) {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
center ? MainAxisAlignment.center : MainAxisAlignment.start,
|
center ? MainAxisAlignment.center : MainAxisAlignment.start,
|
||||||
|
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_electronicKey_admin.png',
|
'images/icon_electronicKey_admin.png',
|
||||||
@ -539,7 +794,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: ScreenUtil().screenWidth - 20.w,
|
width: ScreenUtil().screenWidth - 20.w,
|
||||||
child: GridView.count(
|
child: GridView.count(
|
||||||
crossAxisCount: F.sw(defaultCall: () => 4, xhjCall: () => 3),
|
crossAxisCount: 4,
|
||||||
// childAspectRatio: 3,
|
// childAspectRatio: 3,
|
||||||
crossAxisSpacing: 20.w,
|
crossAxisSpacing: 20.w,
|
||||||
mainAxisSpacing: 0.h,
|
mainAxisSpacing: 0.h,
|
||||||
@ -584,14 +839,12 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: ScreenUtil().screenWidth - 20.w,
|
width: ScreenUtil().screenWidth - 20.w,
|
||||||
child: GridView.count(
|
child: GridView.count(
|
||||||
crossAxisCount: F.sw(defaultCall: () => 4, xhjCall: () => 3),
|
crossAxisCount: 4,
|
||||||
// childAspectRatio: 3,
|
// childAspectRatio: 3,
|
||||||
crossAxisSpacing: 25.h,
|
crossAxisSpacing: 25.h,
|
||||||
mainAxisSpacing: 0.h,
|
mainAxisSpacing: 0.h,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
children: F.sw(
|
children: getBottomWidget()),
|
||||||
defaultCall: () => getBottomWidget(),
|
|
||||||
xhjCall: () => getBottomWidget().reversed.toList())),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,8 +1088,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
//
|
//
|
||||||
Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable,
|
Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable,
|
||||||
bool bottomBtnisEable, Function() onClick) {
|
bool bottomBtnisEable, Function() onClick) {
|
||||||
var width = F.sw(defaultCall: () => 42.w, xhjCall: () => 63.w);
|
|
||||||
var height = F.sw(defaultCall: () => 42.h, xhjCall: () => 63.h);
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: openDoorBtnisUneable
|
onTap: openDoorBtnisUneable
|
||||||
? (bottomBtnisEable
|
? (bottomBtnisEable
|
||||||
@ -852,12 +1103,13 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: width,
|
width: 42.w,
|
||||||
height: height,
|
height: 42.h,
|
||||||
child: FlavorsImg(
|
child: FlavorsImg(
|
||||||
|
black: true,
|
||||||
child: Image.asset(iconUrl,
|
child: Image.asset(iconUrl,
|
||||||
width: width,
|
width: 42.w,
|
||||||
height: height,
|
height: 42.w,
|
||||||
color: openDoorBtnisUneable
|
color: openDoorBtnisUneable
|
||||||
? (bottomBtnisEable
|
? (bottomBtnisEable
|
||||||
? AppColors.mainColor
|
? AppColors.mainColor
|
||||||
@ -916,28 +1168,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
return 'images/main/icon_lockElectricLevel_5.png';
|
return 'images/main/icon_lockElectricLevel_5.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
//开锁成功弹出的小界面
|
|
||||||
void _showFullScreenOverlay(BuildContext context) {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.of(context).pop(); // 关闭底部表单
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
height: MediaQuery.of(context).size.height,
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
color: Colors.black.withOpacity(0.5),
|
|
||||||
child: _unlockSuccessWidget(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _unlockSuccessWidget() {
|
Widget _unlockSuccessWidget() {
|
||||||
return Stack(
|
return Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
@ -1026,8 +1256,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
// TODO: implement dispose
|
|
||||||
|
|
||||||
/// 取消路由订阅
|
/// 取消路由订阅
|
||||||
Get.log("LockDetailPage===dispose");
|
Get.log("LockDetailPage===dispose");
|
||||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||||
@ -1036,7 +1264,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
state.replySubscription.cancel();
|
state.replySubscription.cancel();
|
||||||
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent!
|
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent!
|
||||||
.cancel();
|
.cancel();
|
||||||
|
|
||||||
if (state.animationController != null) {
|
if (state.animationController != null) {
|
||||||
state.animationController!.dispose();
|
state.animationController!.dispose();
|
||||||
state.animationController = null;
|
state.animationController = null;
|
||||||
|
|||||||
@ -36,7 +36,8 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
|||||||
final state = Get.find<LockMainLogic>().state;
|
final state = Get.find<LockMainLogic>().state;
|
||||||
|
|
||||||
Future<void> getHttpData() async {
|
Future<void> getHttpData() async {
|
||||||
LockListInfoGroupEntity? lockListInfoGroupEntity = await Storage.getLockMainListData();
|
LockListInfoGroupEntity? lockListInfoGroupEntity =
|
||||||
|
await Storage.getLockMainListData();
|
||||||
// Get.log("lockListInfoGroupEntity:${lockListInfoGroupEntity!.groupList!.length}");
|
// Get.log("lockListInfoGroupEntity:${lockListInfoGroupEntity!.groupList!.length}");
|
||||||
if (lockListInfoGroupEntity != null) {
|
if (lockListInfoGroupEntity != null) {
|
||||||
var localLockListInfoGroupEntity = lockListInfoGroupEntity;
|
var localLockListInfoGroupEntity = lockListInfoGroupEntity;
|
||||||
@ -71,44 +72,49 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
Widget child = EasyRefreshTool(
|
||||||
backgroundColor: const Color(0xFFF5F5F5),
|
onRefresh: () {
|
||||||
appBar: widget.showAppBar
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||||
? TitleAppBar(
|
// 更新状态的代码
|
||||||
barTitle: F.navTitle,
|
logic.pageNo = 1;
|
||||||
haveBack: false,
|
getHttpData();
|
||||||
haveOtherLeftWidget: true,
|
});
|
||||||
leftWidget: Builder(
|
},
|
||||||
builder: (context) => IconButton(
|
// child: getDataReturnUI(state.dataLength.value));
|
||||||
icon: Image.asset(
|
child: getDataReturnUI(state.dataLength.value));
|
||||||
"images/main/mainLeft_menu_icon.png",
|
if (widget.showAppBar || widget.showDrawer) {
|
||||||
color: Colors.white,
|
child = Scaffold(
|
||||||
width: 44.w,
|
backgroundColor: const Color(0xFFF5F5F5),
|
||||||
height: 44.w,
|
appBar: widget.showAppBar
|
||||||
),
|
? TitleAppBar(
|
||||||
onPressed: () {
|
barTitle: F.navTitle,
|
||||||
Scaffold.of(context).openDrawer();
|
haveBack: false,
|
||||||
},
|
haveOtherLeftWidget: true,
|
||||||
)),
|
leftWidget: Builder(
|
||||||
backgroundColor: AppColors.mainColor,
|
builder: (context) => IconButton(
|
||||||
)
|
icon: Image.asset(
|
||||||
: null,
|
"images/main/mainLeft_menu_icon.png",
|
||||||
drawer: widget.showDrawer
|
color: Colors.white,
|
||||||
? Drawer(
|
width: 44.w,
|
||||||
width: 1.sw / 3 * 2,
|
height: 44.w,
|
||||||
child: const StarLockMinePage(),
|
),
|
||||||
)
|
onPressed: () {
|
||||||
: null,
|
Scaffold.of(context).openDrawer();
|
||||||
body: EasyRefreshTool(
|
},
|
||||||
onRefresh: () {
|
)),
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
backgroundColor: AppColors.mainColor,
|
||||||
// 更新状态的代码
|
)
|
||||||
logic.pageNo = 1;
|
: null,
|
||||||
getHttpData();
|
drawer: widget.showDrawer
|
||||||
});
|
? Drawer(
|
||||||
},
|
width: 1.sw / 3 * 2,
|
||||||
child: getDataReturnUI(state.dataLength.value)),
|
child: const StarLockMinePage(),
|
||||||
);
|
)
|
||||||
|
: null,
|
||||||
|
body: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return child;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getDataReturnUI(int type) {
|
Widget getDataReturnUI(int type) {
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockMian/lockMain/lockMain_page.dart';
|
||||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_state.dart';
|
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
@ -12,6 +15,29 @@ class LockMainXHJLogic extends BaseGetXController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//打开设备弹窗
|
||||||
|
void openEquipment() {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: Get.context!,
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
builder: (context) {
|
||||||
|
return ClipRRect(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(16.r),
|
||||||
|
topRight: Radius.circular(16.r),
|
||||||
|
),
|
||||||
|
child: SizedBox(
|
||||||
|
height: Get.height * 0.7,
|
||||||
|
child: StarLockMainPage(
|
||||||
|
showAppBar: false,
|
||||||
|
showDrawer: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|||||||
@ -41,14 +41,25 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
|||||||
builder: (LockMainXHJLogic logic) {
|
builder: (LockMainXHJLogic logic) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: const Color(0xFFF5F5F5),
|
backgroundColor: const Color(0xFFF5F5F5),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
shape: const CircleBorder(),
|
||||||
|
onPressed: () {
|
||||||
|
logic.openEquipment();
|
||||||
|
},
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
tooltip: TranslationLoader.lanKeys!.device!.tr,
|
||||||
|
child: const Icon(
|
||||||
|
Icons.key,
|
||||||
|
color: AppColors.darkGrayTextColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
bottom: false,
|
bottom: false,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
pageView(
|
pageView(
|
||||||
widget: StarLockMainPage(
|
widget: LockMallPage(
|
||||||
showAppBar: false,
|
showAppBar: false,
|
||||||
showDrawer: false,
|
|
||||||
),
|
),
|
||||||
logic: logic,
|
logic: logic,
|
||||||
index: 0,
|
index: 0,
|
||||||
@ -60,20 +71,13 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
|||||||
logic: logic,
|
logic: logic,
|
||||||
index: 1,
|
index: 1,
|
||||||
),
|
),
|
||||||
pageView(
|
|
||||||
widget: LockMallPage(
|
|
||||||
showAppBar: false,
|
|
||||||
),
|
|
||||||
logic: logic,
|
|
||||||
index: 2,
|
|
||||||
),
|
|
||||||
pageView(
|
pageView(
|
||||||
widget: MinePersonInfoPage(
|
widget: MinePersonInfoPage(
|
||||||
showAppBar: false,
|
showAppBar: false,
|
||||||
showAbout: true,
|
showAbout: true,
|
||||||
),
|
),
|
||||||
logic: logic,
|
logic: logic,
|
||||||
index: 3,
|
index: 2,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -93,26 +97,18 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
|||||||
top: false,
|
top: false,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
// navigationBarItem(Icons.start, '场景', false, () {
|
navigationBarItem(Icons.shopping_cart, '商城'.tr, logic, 0,
|
||||||
// logic.setIndex(0);
|
() {
|
||||||
// }),
|
|
||||||
|
|
||||||
navigationBarItem(Icons.devices,
|
|
||||||
TranslationLoader.lanKeys!.device!.tr, logic, 0, () {
|
|
||||||
logic.setIndex(0);
|
logic.setIndex(0);
|
||||||
}),
|
}),
|
||||||
navigationBarItem(Icons.message,
|
navigationBarItem(Icons.message,
|
||||||
TranslationLoader.lanKeys!.message!.tr, logic, 1, () {
|
TranslationLoader.lanKeys!.message!.tr, logic, 1, () {
|
||||||
logic.setIndex(1);
|
logic.setIndex(1);
|
||||||
}),
|
}),
|
||||||
navigationBarItem(Icons.shopping_cart, '商城'.tr, logic, 2,
|
navigationBarItem(Icons.account_circle, '我的'.tr, logic, 2,
|
||||||
() {
|
() {
|
||||||
logic.setIndex(2);
|
logic.setIndex(2);
|
||||||
}),
|
}),
|
||||||
navigationBarItem(Icons.account_circle, '我的'.tr, logic, 3,
|
|
||||||
() {
|
|
||||||
logic.setIndex(3);
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -4,18 +4,21 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
|
|
||||||
class FlavorsImg extends StatelessWidget {
|
class FlavorsImg extends StatelessWidget {
|
||||||
FlavorsImg({required this.child, key});
|
FlavorsImg({required this.child, this.black = false, key});
|
||||||
|
|
||||||
|
bool black;
|
||||||
Widget child;
|
Widget child;
|
||||||
|
|
||||||
ColorFilterGenerator myFilter = ColorFilterGenerator(name: "xhj", filters: [
|
ColorFilterGenerator myFilter =
|
||||||
// ColorFilterAddons.addictiveColor(1, 22, 93),
|
ColorFilterGenerator(name: "xhj", filters: []);
|
||||||
ColorFilterAddons.addictiveColor(1, 22, 93),
|
|
||||||
// ColorFilterAddons.grayscale(),z
|
|
||||||
]);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
myFilter = ColorFilterGenerator(name: "xhj", filters: [
|
||||||
|
black
|
||||||
|
? ColorFilterAddons.addictiveColor(-255, -255, -255)
|
||||||
|
: ColorFilterAddons.addictiveColor(1, 22, 93),
|
||||||
|
]);
|
||||||
if (F.appFlavor != Flavor.xhj) {
|
if (F.appFlavor != Flavor.xhj) {
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,8 +34,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# 1.0.28+2024041702:打包给欧阳回归测试
|
# 1.0.28+2024041702:打包给欧阳回归测试
|
||||||
# 1.0.27+2024041702 打包星星锁提审华为
|
# 1.0.27+2024041702 打包星星锁提审华为
|
||||||
# 1.0.27+2024041703 打包星星锁提审ios
|
# 1.0.27+2024041703 打包星星锁提审ios
|
||||||
|
# 1.0.27+2024042204 打包星星锁提审ios与 android
|
||||||
|
|
||||||
version: 1.0.27+2024041803
|
version: 1.0.27+2024042204
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: '>=2.12.0 <3.0.0'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user