diff --git a/star_lock/images/icon_bar_more.png b/star_lock/images/icon_bar_more.png new file mode 100644 index 00000000..053fce9a Binary files /dev/null and b/star_lock/images/icon_bar_more.png differ diff --git a/star_lock/images/icon_bar_search.png b/star_lock/images/icon_bar_search.png new file mode 100644 index 00000000..6ca01fb2 Binary files /dev/null and b/star_lock/images/icon_bar_search.png differ diff --git a/star_lock/images/icon_right_grey.png b/star_lock/images/icon_right_grey.png new file mode 100644 index 00000000..cbde169d Binary files /dev/null and b/star_lock/images/icon_right_grey.png differ diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index 6e9c5107..c015147b 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -188,6 +188,7 @@ "lanChinese":"Chinese", "multilingual":"Multilingual", "addLock":"Add Lock", + "addDevice":"Add device", "gateway":"Gateway", "message":"Message", "supportStaff":"Support Staff", @@ -201,6 +202,7 @@ "lockUserManagement":"Lock User Management", "aboutToExpire":"About to expire", "authorizedAdmin":"Authorized Admin", + "addAuthorizedAdmin":"Adding an Authorized Administrator", "lockGroup":"Lock Group", "transferSmartLock":"Transfer Smart Lock", "selectiveLock":"Selective lock", @@ -230,7 +232,9 @@ "safetyProblem":"Safety Problem", "modifyAccountTip":"For the security of your account, please use the account password verification before modifying the account", "pleaseEnterAccountNumber":"Please enter your account number", + "pleaseEnterNewAccountNumber":"Please enter your new account number", "changeIphoneTip":"When you retrieve your password and log in to a new device, you can verify it with the attached phone", + "changeEmailTip":"When you retrieve your password and log in to a new device, you can verify it with the attached Email", "originalPassword":"Original Password", "newPassword":"New Password", "surePassword":"Sure Password", @@ -276,6 +280,7 @@ "padlock":"Pad lock", "safeLock":"Safe Lock", "intelligentLockCore":"Intelligent Lock Core", + "itelligentAccessControl":"Intelligent access control", "parkingLock":"Parking Lock", "bicycleLock":"Bicycle Lock", "longRangeControl":"LongRange Control", diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 79399173..6199a990 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -188,6 +188,7 @@ "lanChinese":"lanChinese", "multilingual":"multilingual", "addLock":"addLock", + "addDevice":"addDevice", "gateway":"gateway", "message":"message", "supportStaff":"supportStaff", @@ -200,6 +201,7 @@ "pushNotification":"pushNotification", "lockUserManagement":"lockUserManagement", "authorizedAdmin":"authorizedAdmin", + "addAuthorizedAdmin":"addAuthorizedAdmin", "lockGroup":"lockGroup", "transferSmartLock":"transferSmartLock", "selectiveLock":"selectiveLock", @@ -229,7 +231,9 @@ "safetyProblem":"safetyProblem", "modifyAccountTip":"modifyAccountTip", "pleaseEnterAccountNumber":"pleaseEnterAccountNumber", + "pleaseEnterNewAccountNumber":"pleaseEnterNewAccountNumber", "changeIphoneTip":"changeIphoneTip", + "changeEmailTip":"changeEmailTip", "originalPassword":"originalPassword", "newPassword":"newPassword", "surePassword":"surePassword", @@ -276,6 +280,7 @@ "padlock":"padlock", "safeLock":"safeLock", "intelligentLockCore":"intelligentLockCore", + "itelligentAccessControl":"itelligentAccessControl", "parkingLock":"parkingLock", "bicycleLock":"bicycleLock", "longRangeControl":"longRangeControl", diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 9700d58b..7d913bc3 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -188,6 +188,7 @@ "lanChinese":"中文", "multilingual":"多语言", "addLock":"添加锁", + "addDevice":"添加设备", "gateway":"网关", "message":"消息", "supportStaff":"客服", @@ -200,6 +201,7 @@ "pushNotification":"消息推送", "lockUserManagement":"锁用户管理", "authorizedAdmin":"授权管理员", + "addAuthorizedAdmin":"添加授权管理员", "lockGroup":"锁分组", "transferSmartLock":"转移智能锁", "selectiveLock":"选择锁", @@ -229,7 +231,9 @@ "safetyProblem":"安全问题", "modifyAccountTip":"为了你的账号安全,修改账号前请先使用账号密码验证", "pleaseEnterAccountNumber":"请输入账号", - "changeIphoneTip":"找回密码和登陆新设备时,可通过绑定的手机验证", + "pleaseEnterNewAccountNumber":"请输入新账号", + "changeIphoneTip":"找回密码和登录新设备时,可通过绑定的手机验证", + "changeEmailTip":"找回密码和登录新设备时,可通过绑定的邮箱验证", "originalPassword":"原密码", "newPassword":"新密码", "surePassword":"确认密码", @@ -276,11 +280,12 @@ "padlock":"挂锁", "safeLock":"保险箱锁", "intelligentLockCore":"智能锁芯", + "itelligentAccessControl":"智能门禁", "parkingLock":"车位锁", "bicycleLock":"自行车锁", "longRangeControl":"远程控制", "lightTouchScreen":"摸亮触摸屏", - "lightTouchScreenTip":"摸亮触摸屏,锁进入可添加状态,点击下一步", + "lightTouchScreenTip":"摸亮触摸屏,锁进入可添加状态,点击下一步", "next":"下一步", "nearbyLock":"附近的锁", "addSuccessfullyPleaseRename":"添加成功,请重命名", diff --git a/star_lock/images/main/icon_main_openLockBtn.png b/star_lock/images/main/icon_main_openLockBtn.png index 52cf88e5..f2e2bda5 100644 Binary files a/star_lock/images/main/icon_main_openLockBtn.png and b/star_lock/images/main/icon_main_openLockBtn.png differ diff --git a/star_lock/images/main/icon_main_remoteUnlocking.png b/star_lock/images/main/icon_main_remoteUnlocking.png index 46924b35..c7fd44de 100644 Binary files a/star_lock/images/main/icon_main_remoteUnlocking.png and b/star_lock/images/main/icon_main_remoteUnlocking.png differ diff --git a/star_lock/images/mine/icon_mine_editPersonInfo.png b/star_lock/images/mine/icon_mine_editPersonInfo.png new file mode 100644 index 00000000..bf78f41c Binary files /dev/null and b/star_lock/images/mine/icon_mine_editPersonInfo.png differ diff --git a/star_lock/images/mine/icon_mine_main_defaultAvatar.png b/star_lock/images/mine/icon_mine_main_defaultAvatar.png index 1a1012d1..927da454 100644 Binary files a/star_lock/images/mine/icon_mine_main_defaultAvatar.png and b/star_lock/images/mine/icon_mine_main_defaultAvatar.png differ diff --git a/star_lock/images/mine/icon_mine_topBg.png b/star_lock/images/mine/icon_mine_topBg.png new file mode 100644 index 00000000..1e96c71a Binary files /dev/null and b/star_lock/images/mine/icon_mine_topBg.png differ diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index 511ecde2..8494412b 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart'; +import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart'; import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart'; import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_page.dart'; import 'package:star_lock/mine/mineSet/mineSet_page.dart'; @@ -202,6 +204,8 @@ abstract class Routers { '/MinePersonInfoResetPasswordPage'; // 我的信息重置密码 static const minePersonInfoSetSafetyProblemPage = '/MinePersonInfoSetSafetyProblemPage'; // 我的信息设置安全问题 + static const minePersonInfoEditEmailPage = + '/MinePersonInfoEditEmailPage'; //我的信息-邮箱 static const gatewayListPage = '/GatewayListPage'; // 我的-网关 static const gatewayDetailPage = '/GatewayDetailPage'; // 我的-网关详情 @@ -253,6 +257,8 @@ abstract class Routers { static const recipientInformationPage = '/recipientInformationPage'; //接受人信息 static const selectBranchPage = '/SelectBranchPage'; //选择分店 static const selectGetewayListPage = '/selectGetewayListPage'; //选择网关 + static const addAuthorizedAdministratorPage = + '/addAuthorizedAdministratorPage'; //添加授权管理员 static const starLockLoginPage = '/StarLockLoginPage'; // 登录 static const starLockRegisterPage = '/StarLockRegisterPage'; // 注册 @@ -675,6 +681,12 @@ abstract class AppRouters { name: Routers.selectBranchPage, page: () => const SelectBranchPage()), GetPage( name: Routers.selectGetewayListPage, - page: () => const SelectGetewayListPage()) + page: () => const SelectGetewayListPage()), + GetPage( + name: Routers.minePersonInfoEditEmailPage, + page: () => const MinePersonInfoEditEmailPage()), + GetPage( + name: Routers.addAuthorizedAdministratorPage, + page: () => const AddAuthorizedAdministratorPage()) ]; } diff --git a/star_lock/lib/app_settings/app_colors.dart b/star_lock/lib/app_settings/app_colors.dart index 746a9ab9..da75713e 100644 --- a/star_lock/lib/app_settings/app_colors.dart +++ b/star_lock/lib/app_settings/app_colors.dart @@ -115,7 +115,9 @@ class AppColors { static Color progressBgColor = const Color(0xFF022345); static Color progressValueColor = const Color(0xFF0093E5); - static const greyLineColor = Color.fromRGBO(240, 240, 240, 1); //灰色分割线 + static const greyLineColor = Color.fromRGBO(220, 220, 220, 1); //灰色分割线 static const darkGrayTextColor = Color.fromRGBO(65, 65, 65, 1); //深灰色字体 static const placeholderTextColor = Color.fromRGBO(128, 128, 128, 1); //占位字体颜色 + static const greyBackgroundColor = Color.fromRGBO(240, 240, 240, 1); //灰色背景色 + static const btnDisableColor = Color.fromRGBO(178, 178, 178, 1); //按钮不可用灰色 } diff --git a/star_lock/lib/main.dart b/star_lock/lib/main.dart index d150cb7d..4a489821 100644 --- a/star_lock/lib/main.dart +++ b/star_lock/lib/main.dart @@ -35,7 +35,7 @@ class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { @override Widget build(BuildContext context) { return ScreenUtilInit( - designSize: const Size(750, 1334), + designSize: const Size(585, 1265), builder: (w, a) => _initMaterialApp()); } diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart index 9ccf59bc..fb3f04e0 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -11,20 +10,26 @@ class AuthorizedAdminManagePage extends StatefulWidget { const AuthorizedAdminManagePage({Key? key}) : super(key: key); @override - State createState() => _AuthorizedAdminManagePageState(); + State createState() => + _AuthorizedAdminManagePageState(); } class _AuthorizedAdminManagePageState extends State { - var index=0; + var index = 0; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.authorizedAdmin!.tr, haveBack:true, backgroundColor: AppColors.mainColor), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.authorizedAdmin!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), body: Column( children: [ - AuthorizedAdminManageTabbar(initialIndex: index,), + AuthorizedAdminManageTabbar( + initialIndex: index, + ), ], ), ); diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart index 4fa80c62..1a8ed05f 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -15,7 +14,8 @@ class AuthorizedAdminDetailPage extends StatefulWidget { const AuthorizedAdminDetailPage({Key? key}) : super(key: key); @override - State createState() => _AuthorizedAdminDetailPageState(); + State createState() => + _AuthorizedAdminDetailPageState(); } class _AuthorizedAdminDetailPageState extends State { @@ -23,51 +23,82 @@ class _AuthorizedAdminDetailPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys!.authorizedAdmin!.tr}${TranslationLoader.lanKeys!.detail!.tr}", haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ - TextButton( - child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white),), - onPressed: (){ - - },), - ],), + appBar: TitleAppBar( + barTitle: + "${TranslationLoader.lanKeys!.authorizedAdmin!.tr}${TranslationLoader.lanKeys!.detail!.tr}", + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.share!.tr, + style: TextStyle(color: Colors.white, fontSize: 24.sp), + ), + onPressed: () {}, + ), + ], + ), body: Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.password!.tr, rightTitle:"98765432", isHaveDirection: true, isHaveLine: true, action:(){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.name!.tr, rightTitle:"你好", isHaveDirection: true, isHaveLine: true, action:(){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, rightTitle:"永久", isHaveDirection: true, action:(){ - Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.password!.tr, + rightTitle: "98765432", + isHaveDirection: true, + isHaveLine: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: "你好", + isHaveDirection: true, + isHaveLine: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + rightTitle: "永久", + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.electronicKeyDetailChangeDate); + }), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.sender!.tr, rightTitle:"15080825640", action:(){ - - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.senderTime!.tr, rightTitle:"2020.06.21 11:49", action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.sender!.tr, + rightTitle: "15080825640", + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.senderTime!.tr, + rightTitle: "2020.06.21 11:49", + action: () {}), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.operatingRecord!.tr, rightTitle:"", isHaveDirection: true, action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, + rightTitle: "", + isHaveDirection: true, + action: () {}), Container(height: 40.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, + isDelete: true, borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + margin: EdgeInsets.only( + left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ - - } - ), + onClick: () {}), ], ), ); } - Widget commonItem(String leftTitle, String rightTitle, {bool isHaveDirection = false, bool isHaveLine = false, bool isHaveRightWidget = false, Widget? rightWidget, Function()? action}){ + Widget commonItem(String leftTitle, String rightTitle, + {bool isHaveDirection = false, + bool isHaveLine = false, + bool isHaveRightWidget = false, + Widget? rightWidget, + Function()? action}) { return GestureDetector( onTap: action, child: Column( @@ -76,27 +107,50 @@ class _AuthorizedAdminDetailPageState extends State { Container( // height: 80.h, color: Colors.white, - padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + padding: EdgeInsets.only( + left: 20.w, right: 10.w, top: 20.w, bottom: 20.w), child: Row( children: [ - SizedBox(width:20.w), - Text(leftTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), - SizedBox(width:20.w), + SizedBox(width: 20.w), + Text( + leftTitle, + style: + TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), + ), + SizedBox(width: 20.w), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - isHaveRightWidget?rightWidget!:Text(rightTitle, textAlign: TextAlign.end,style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + isHaveRightWidget + ? rightWidget! + : Text( + rightTitle, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 28.sp, fontWeight: FontWeight.w500), + ) ], ), ), - SizedBox(width:5.w), - isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + SizedBox(width: 5.w), + isHaveDirection + ? Image.asset( + 'images/icon_right.png', + width: 50.w, + height: 50.w, + ) + : SizedBox(width: 10.w), // SizedBox(width:10.w), ], ), ), - isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + isHaveLine + ? Container( + height: 0.5.h, + color: Colors.grey, + ) + : Container() ], ), ); @@ -112,7 +166,9 @@ class _AuthorizedAdminDetailPageState extends State { title: const Text("修改密码"), content: Column( children: [ - const SizedBox(height: 10,), + const SizedBox( + height: 10, + ), Container( height: 80.h, // color: Colors.white, @@ -172,5 +228,4 @@ class _AuthorizedAdminDetailPageState extends State { ); }); } - } diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart index 64441ddf..0ac8d08f 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart @@ -56,7 +56,7 @@ class _AuthorizedAdminListPageState extends State { Widget _searchWidget() { return Container( height: 60.h, - margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w), + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5)), child: TextField( @@ -64,17 +64,19 @@ class _AuthorizedAdminListPageState extends State { maxLines: 1, // controller: _controller, autofocus: false, + decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only( top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart index 75f0033d..8fe513f9 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLock_page.dart @@ -1,4 +1,4 @@ - +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -12,13 +12,16 @@ import '../../../../translations/trans_lib.dart'; class VolumeAuthorizationLockPage extends StatefulWidget { final String type; - const VolumeAuthorizationLockPage({Key? key, required this.type}):super(key:key); + const VolumeAuthorizationLockPage({Key? key, required this.type}) + : super(key: key); @override - State createState() => _VolumeAuthorizationLockPageState(); + State createState() => + _VolumeAuthorizationLockPageState(); } -class _VolumeAuthorizationLockPageState extends State { +class _VolumeAuthorizationLockPageState + extends State { final FlutterContactPicker _contactPicker = FlutterContactPicker(); late Contact _contact; @@ -31,10 +34,9 @@ class _VolumeAuthorizationLockPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys!.checkingIn!.tr} ${TranslationLoader.lanKeys!.set!.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + appBar: TitleAppBar( + barTitle: + "${TranslationLoader.lanKeys!.checkingIn!.tr} ${TranslationLoader.lanKeys!.set!.tr}", + haveBack: true, + backgroundColor: AppColors.mainColor), body: Column( children: [ - CommonItem(leftTitel:"${TranslationLoader.lanKeys!.company!.tr} ${TranslationLoader.lanKeys!.name!.tr}", rightTitle:"深圳市志超科技", isHaveLine: true, isHaveDirection: true, action: (){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.staff!.tr, rightTitle:"0", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.checkingInStaffManagePage); - }), - CommonItem(leftTitel:"${TranslationLoader.lanKeys!.work!.tr} ${TranslationLoader.lanKeys!.time!.tr}", rightTitle:"9:00 - 18:00", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.checkingInSetWorkTimePage); - }), - CommonItem(leftTitel:"${TranslationLoader.lanKeys!.workday!.tr} ${TranslationLoader.lanKeys!.set!.tr}", rightTitle:"1,2,3,4,5", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.checkingInSetWorkdaySet); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.holidays!.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.checkingInSetHolidaysPage); - }), - SizedBox(height: 30.h,), - SubmitBtn(btnName: "${TranslationLoader.lanKeys!.delete!.tr} ${TranslationLoader.lanKeys!.company!.tr}", + CommonItem( + leftTitel: + "${TranslationLoader.lanKeys!.company!.tr} ${TranslationLoader.lanKeys!.name!.tr}", + rightTitle: "深圳市志超科技", + isHaveLine: true, + isHaveDirection: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.staff!.tr, + rightTitle: "0", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.checkingInStaffManagePage); + }), + CommonItem( + leftTitel: + "${TranslationLoader.lanKeys!.work!.tr} ${TranslationLoader.lanKeys!.time!.tr}", + rightTitle: "9:00 - 18:00", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.checkingInSetWorkTimePage); + }), + CommonItem( + leftTitel: + "${TranslationLoader.lanKeys!.workday!.tr} ${TranslationLoader.lanKeys!.set!.tr}", + rightTitle: "1,2,3,4,5", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.checkingInSetWorkdaySet); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.holidays!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.checkingInSetHolidaysPage); + }), + SizedBox( + height: 30.h, + ), + SubmitBtn( + btnName: + "${TranslationLoader.lanKeys!.delete!.tr} ${TranslationLoader.lanKeys!.company!.tr}", borderRadius: 20.w, fontSize: 32.sp, + isDelete: true, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), padding: EdgeInsets.only(top: 20.w, bottom: 20.w), - onClick: () { - - } - ), + onClick: () {}), ], ), ); @@ -62,7 +95,11 @@ class _CheckingInSetPageState extends State { showDialog( context: context, builder: (BuildContext context) { - return ShowTFView(title:"${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.name!.tr}", tipTitle:"", controller: _changeNameController); + return ShowTFView( + title: + "${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.name!.tr}", + tipTitle: "", + controller: _changeNameController); }); } } diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart index bb89b5f2..4c3b1fc7 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart @@ -15,7 +15,8 @@ class ElectronicKeyDetailPage extends StatefulWidget { const ElectronicKeyDetailPage({Key? key}) : super(key: key); @override - State createState() => _ElectronicKeyDetailPageState(); + State createState() => + _ElectronicKeyDetailPageState(); } class _ElectronicKeyDetailPageState extends State { @@ -26,49 +27,75 @@ class _ElectronicKeyDetailPageState extends State { return Scaffold( resizeToAvoidBottomInset: false, backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.keyDetail!.tr, haveBack:true, backgroundColor: AppColors.mainColor), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.keyDetail!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), body: Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.name!.tr, rightTitle:"魏", isHaveDirection: true, isHaveLine: true, action:(){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, allHeight: 90.h,rightTitle:"2020.06.20 11:49\n2020.06.21 11:49", isHaveDirection: true, action:(){ - Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: "魏", + isHaveDirection: true, + isHaveLine: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + allHeight: 90.h, + rightTitle: "2020.06.20 11:49\n2020.06.21 11:49", + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.electronicKeyDetailChangeDate); + }), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.receiver!.tr, rightTitle:"786612630@qq.com",action:(){ - - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.sender!.tr, rightTitle:"15080825640", action:(){ - - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.senderTime!.tr, rightTitle:"2020.06.21 11:49", action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.receiver!.tr, + rightTitle: "786612630@qq.com", + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.sender!.tr, + rightTitle: "15080825640", + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.senderTime!.tr, + rightTitle: "2020.06.21 11:49", + action: () {}), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.realNameAuthentication!.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w,child: _switch()), action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr, + rightTitle: "", + isHaveRightWidget: true, + rightWidget: Container(width: 80.w, child: _switch()), + action: () {}), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.operatingRecord!.tr, rightTitle:"", isHaveDirection: true, action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, + rightTitle: "", + isHaveDirection: true, + action: () {}), Container(height: 40.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + isDelete: true, + margin: EdgeInsets.only( + left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ - - } - ), + onClick: () {}), ], ), ); } - Widget commonItem(String leftTitle, String rightTitle, {bool isHaveDirection = false, bool isHaveLine = false, bool isHaveRightWidget = false, Widget? rightWidget, Function()? action}){ + Widget commonItem(String leftTitle, String rightTitle, + {bool isHaveDirection = false, + bool isHaveLine = false, + bool isHaveRightWidget = false, + Widget? rightWidget, + Function()? action}) { return GestureDetector( onTap: action, child: Column( @@ -77,41 +104,67 @@ class _ElectronicKeyDetailPageState extends State { Container( // height: 80.h, color: Colors.white, - padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + padding: EdgeInsets.only( + left: 20.w, right: 10.w, top: 20.w, bottom: 20.w), child: Row( children: [ - SizedBox(width:20.w), - Text(leftTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), - SizedBox(width:20.w), + SizedBox(width: 20.w), + Text( + leftTitle, + style: + TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), + ), + SizedBox(width: 20.w), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - isHaveRightWidget?rightWidget!:Text(rightTitle, textAlign: TextAlign.end,style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + isHaveRightWidget + ? rightWidget! + : Text( + rightTitle, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 28.sp, fontWeight: FontWeight.w500), + ) ], ), ), - SizedBox(width:5.w), - isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + SizedBox(width: 5.w), + isHaveDirection + ? Image.asset( + 'images/icon_right.png', + width: 50.w, + height: 50.w, + ) + : SizedBox(width: 10.w), // SizedBox(width:10.w), ], ), ), - isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + isHaveLine + ? Container( + height: 0.5.h, + color: Colors.grey, + ) + : Container() ], ), ); } - Switch _switch(){ - return Switch( - value: false, - onChanged: (value){ - // switchValue = !switchValue; - setState(() { - - }); - } + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, ); } @@ -119,8 +172,11 @@ class _ElectronicKeyDetailPageState extends State { showDialog( context: context, builder: (BuildContext context) { - return ShowTFView(title:"${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.name!.tr}", tipTitle:"请输入", controller: _changeNameController); + return ShowTFView( + title: + "${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.name!.tr}", + tipTitle: "请输入", + controller: _changeNameController); }); } - } diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart index 7763a1fe..40615e15 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart @@ -1,6 +1,6 @@ - import 'package:flutter/material.dart'; import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import '../../../../../app_settings/app_colors.dart'; @@ -13,45 +13,69 @@ class ElectronicKeyDetailChangeDate extends StatefulWidget { const ElectronicKeyDetailChangeDate({Key? key}) : super(key: key); @override - State createState() => _ElectronicKeyDetailChangeDateState(); + State createState() => + _ElectronicKeyDetailChangeDateState(); } -class _ElectronicKeyDetailChangeDateState extends State { - +class _ElectronicKeyDetailChangeDateState + extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.periodValidity!.tr}", haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ - TextButton(child: Text(TranslationLoader.lanKeys!.sure!.tr, style: const TextStyle(color: Colors.white),), onPressed: (){ - - },), - ],), - body: buildMainUI(), + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: + "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.periodValidity!.tr}", + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.sure!.tr, + style: TextStyle(color: Colors.white, fontSize: 24.sp), + ), + onPressed: () {}, + ), + ], + ), + body: buildMainUI(), ); } - Widget buildMainUI(){ + Widget buildMainUI() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, isHaveLine: true, action:(){ - ShowSeletDateTime().showDatePicker(context, '2100-01-01 00:00', '1900-01-01 00:00', getNowDate(),'yyyy-MMMM-dd HH:mm', (dateTime, List index) { - - }); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.failureTime!.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ - ShowSeletDateTime().showDatePicker(context, '00:00', '00:00', getNowDate(),'HH:mm', (dateTime, List index) { - - }); - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveDirection: true, + isHaveLine: true, + action: () { + ShowSeletDateTime().showDatePicker( + context, + '2100-01-01 00:00', + '1900-01-01 00:00', + getNowDate(), + 'yyyy-MMMM-dd HH:mm', + (dateTime, List index) {}); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveDirection: true, + action: () { + ShowSeletDateTime().showDatePicker(context, '00:00', '00:00', + getNowDate(), 'HH:mm', (dateTime, List index) {}); + }), ], ); } - String getNowDate(){ + String getNowDate() { // 获取当前时间对象 DateTime today = DateTime.now(); - String dateSlug ="${today.hour.toString().padLeft(2,'0')}:${today.minute.toString().padLeft(2,'0')}"; + String dateSlug = + "${today.hour.toString().padLeft(2, '0')}:${today.minute.toString().padLeft(2, '0')}"; // //获取当前时间的年 // int year = now.year; diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart index 55b18a7a..131c477e 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart @@ -56,7 +56,7 @@ class _ElectronicKeyListPageState extends State { Widget _searchWidget() { return Container( height: 60.h, - margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w), + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5)), child: TextField( @@ -64,17 +64,19 @@ class _ElectronicKeyListPageState extends State { maxLines: 1, // controller: _controller, autofocus: false, + decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only( top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart index 7f8bcb87..3648016a 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyPeriodValidity_page.dart @@ -12,26 +12,32 @@ class ElectronicKeyPeriodValidityPage extends StatefulWidget { const ElectronicKeyPeriodValidityPage({Key? key}) : super(key: key); @override - State createState() => _ElectronicKeyPeriodValidityPageState(); + State createState() => + _ElectronicKeyPeriodValidityPageState(); } -class _ElectronicKeyPeriodValidityPageState extends State { +class _ElectronicKeyPeriodValidityPageState + extends State { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.periodValidity!.tr, haveBack:true, backgroundColor: AppColors.mainColor), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.periodValidity!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), body: Column( children: [ topWidget(), - SizedBox(height: 10.h,), + SizedBox( + height: 1.h, + ), bottomWidget() ], - ) - ); + )); } - Widget topWidget(){ + Widget topWidget() { return Container( height: 150.h, width: 1.sw, @@ -42,28 +48,26 @@ class _ElectronicKeyPeriodValidityPageState extends State createState() => _MassSendElectronicKeyPageState(); + State createState() => + _MassSendElectronicKeyPageState(); } class _MassSendElectronicKeyPageState extends State { @@ -32,10 +34,9 @@ class _MassSendElectronicKeyPageState extends State { void initState() { // TODO: implement initState super.initState(); - } - Widget indexChangeWidget(){ + Widget indexChangeWidget() { switch (int.parse(widget.type)) { case 0: { @@ -82,82 +83,99 @@ class _MassSendElectronicKeyPageState extends State { } // 顶部钥匙信息widget - Widget keyInfoWidget(){ + Widget keyInfoWidget() { return Column( children: [ Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.receiver!.tr, rightTitle:TranslationLoader.lanKeys!.pleaseAdd!.tr, isHaveLine: true, isHaveDirection: true, action: (){ - - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.lock!.tr, rightTitle:TranslationLoader.lanKeys!.pleaseSelet!.tr, isHaveDirection: true, action: (){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.receiver!.tr, + rightTitle: TranslationLoader.lanKeys!.pleaseAdd!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.lock!.tr, + rightTitle: TranslationLoader.lanKeys!.pleaseSelet!.tr, + isHaveDirection: true, + action: () {}), Container(height: 10.h), ], ); } // 生效失效时间 - Widget keyTimeWidget(){ + Widget keyTimeWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true), - CommonItem(leftTitel:TranslationLoader.lanKeys!.failureTime!.tr, rightTitle:"2020.06.20 11:49", ), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveLine: true), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, + rightTitle: "2020.06.20 11:49", + ), Container(height: 10.h), ], ); } // 远程开锁 - Widget remoteUnlockingWidget(){ + Widget remoteUnlockingWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch()), action:(){ - - }), - Container(height: 10.h), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr, + rightTitle: "", + isHaveRightWidget: true, + rightWidget: Container(width: 80.w, height: 50.h, child: _switch()), + action: () {}), + Container(height: 40.h), ], ); } // 有效期 - Widget periodValidityWidget(){ + Widget periodValidityWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.periodValidity!.tr, rightTitle:"", isHaveDirection: true, action:(){ - Navigator.pushNamed(context, Routers.electronicKeyPeriodValidityPage); - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, + rightTitle: "", + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.electronicKeyPeriodValidityPage); + }), Container(height: 10.h), ], ); } - Widget keyBottomWidget(){ + Widget keyBottomWidget() { return Column( children: [ SubmitBtn( btnName: TranslationLoader.lanKeys!.send!.tr, - borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), - padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ + onClick: () { // Navigator.pushNamed(context, Routers.nearbyLockPage); - } - ), + }), ], ); } - Switch _switch(){ - return Switch( - value: false, - onChanged: (value){ - // switchValue = !switchValue; - setState(() { - - }); - } + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, ); } - } diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_tabbar.dart index c6fb8264..83d42fb3 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_tabbar.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_tabbar.dart @@ -8,15 +8,19 @@ import '../../../../../translations/trans_lib.dart'; import '../massSendElectronicKey_page.dart'; class MassSendElectronicKeyManageTabbar extends StatefulWidget { - var initialIndex=1; + var initialIndex = 1; - MassSendElectronicKeyManageTabbar({Key? key, required this.initialIndex}) : super(key: key); + MassSendElectronicKeyManageTabbar({Key? key, required this.initialIndex}) + : super(key: key); @override - State createState() => _MassSendElectronicKeyManageTabbarState(); + State createState() => + _MassSendElectronicKeyManageTabbarState(); } -class _MassSendElectronicKeyManageTabbarState extends State with SingleTickerProviderStateMixin { +class _MassSendElectronicKeyManageTabbarState + extends State + with SingleTickerProviderStateMixin { late TabController _tabController; final List _itemTabs = [ @@ -29,33 +33,44 @@ class _MassSendElectronicKeyManageTabbarState extends State _tab(item)).toList(), isScrollable: true, indicatorColor: Colors.red, unselectedLabelColor: Colors.black, - unselectedLabelStyle: TextStyle(color:AppColors.mainColor,fontSize: 28.sp,), - automaticIndicatorColorAdjustment:true, + unselectedLabelStyle: TextStyle( + color: AppColors.mainColor, + fontSize: 28.sp, + ), + automaticIndicatorColorAdjustment: true, labelColor: AppColors.mainColor, - labelStyle: TextStyle(color: AppColors.mainColor,fontSize: 32.sp,fontWeight: FontWeight.w600), - indicator: CustomUnderlineTabIndicator(borderSide: BorderSide(color: AppColors.mainColor,width: 10.w),strokeCap: StrokeCap.round,width: 0.w), + labelStyle: TextStyle( + color: AppColors.mainColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + indicator: CustomUnderlineTabIndicator( + borderSide: BorderSide(color: AppColors.mainColor, width: 4.w), + strokeCap: StrokeCap.round, + width: 30.w), ); } @@ -63,19 +78,27 @@ class _MassSendElectronicKeyManageTabbarState extends State MassSendElectronicKeyPage(type: item.type,)).toList(), + children: _itemTabs + .map((ItemView item) => MassSendElectronicKeyPage( + type: item.type, + )) + .toList(), ), ); } diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart index c91ad57d..10b7e935 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_page.dart @@ -1,4 +1,4 @@ - +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -32,10 +32,9 @@ class _SendElectronicKeyPageState extends State { void initState() { // TODO: implement initState super.initState(); - } - Widget indexChangeWidget(){ + Widget indexChangeWidget() { switch (int.parse(widget.type)) { case 0: { @@ -55,22 +54,14 @@ class _SendElectronicKeyPageState extends State { { // 永久 return Column( - children: [ - keyInfoWidget(), - keyRealNameWidget(), - keyBottomWidget() - ], + children: [keyInfoWidget(), keyRealNameWidget(), keyBottomWidget()], ); } case 2: { // 单次 return Column( - children: [ - keyInfoWidget(), - keyRealNameWidget(), - keyBottomWidget() - ], + children: [keyInfoWidget(), keyRealNameWidget(), keyBottomWidget()], ); } case 3: @@ -91,56 +82,84 @@ class _SendElectronicKeyPageState extends State { } // 顶部钥匙信息widget - Widget keyInfoWidget(){ + Widget keyInfoWidget() { return Column( children: [ Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.receiver!.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget(true, TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr)), - CommonItem(leftTitel:TranslationLoader.lanKeys!.name!.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: getTFWidget(false, TranslationLoader.lanKeys!.enterYourName!.tr)), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.receiver!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: getTFWidget( + true, TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr)), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: "", + isHaveRightWidget: true, + rightWidget: getTFWidget( + false, TranslationLoader.lanKeys!.enterYourName!.tr)), Container(height: 10.h), ], ); } // 生效失效时间 - Widget keyTimeWidget(){ + Widget keyTimeWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true, isHaveDirection: true, action:(){ - // _showDatePicker(); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.failureTime!.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ - // _showDatePicker(); - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveLine: true, + isHaveDirection: true, + action: () { + // _showDatePicker(); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveDirection: true, + action: () { + // _showDatePicker(); + }), Container(height: 10.h), ], ); } // 实名认证 - Widget keyRealNameWidget(){ + Widget keyRealNameWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.realNameAuthentication!.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch()), action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr, + rightTitle: "", + isHaveRightWidget: true, + rightWidget: Container(width: 80.w, height: 50.h, child: _switch()), + action: () {}), Container(height: 10.h), ], ); } // 有效期 - Widget keyPeriodValidityWidget(){ + Widget keyPeriodValidityWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.periodValidity!.tr, rightTitle:"", isHaveDirection: true, action:(){ - Navigator.pushNamed(context, Routers.electronicKeyPeriodValidityPage); - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, + rightTitle: "", + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.electronicKeyPeriodValidityPage); + }), ], ); } - Widget keyBottomWidget(){ + Widget keyBottomWidget() { return Column( children: [ Container( @@ -148,24 +167,32 @@ class _SendElectronicKeyPageState extends State { child: Row( // crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded(child: Text(TranslationLoader.lanKeys!.sendKeyBottomTip!.tr, textAlign: TextAlign.start,)), + Expanded( + child: Text( + TranslationLoader.lanKeys!.sendKeyBottomTip!.tr, + textAlign: TextAlign.start, + )), ], ), ), - SubmitBtn(btnName: TranslationLoader.lanKeys!.send!.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ - - } - ), + SubmitBtn(btnName: TranslationLoader.lanKeys!.send!.tr, onClick: () {}), Container( - padding: EdgeInsets.only(right:30.w), + padding: EdgeInsets.only(right: 30.w), // color: Colors.red, child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - TextButton(onPressed: (){ - Navigator.pushNamed(context, Routers.massSendElectronicKeyManagePage); - }, child: Text(TranslationLoader.lanKeys!.sendGroupKey!.tr, style: TextStyle(color: AppColors.mainColor, fontWeight: FontWeight.w500),)), + TextButton( + onPressed: () { + Navigator.pushNamed( + context, Routers.massSendElectronicKeyManagePage); + }, + child: Text( + TranslationLoader.lanKeys!.sendGroupKey!.tr, + style: TextStyle( + color: AppColors.mainColor, + fontWeight: FontWeight.w500), + )), ], ), ), @@ -174,7 +201,7 @@ class _SendElectronicKeyPageState extends State { } // 发送电子钥匙成功 - Widget sendElectronicKeySucceed(){ + Widget sendElectronicKeySucceed() { return Column( children: [ Container( @@ -183,49 +210,84 @@ class _SendElectronicKeyPageState extends State { color: Colors.white, child: Column( children: [ - SizedBox(height: 30.h,), - Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w, color: AppColors.mainColor,), - SizedBox(height: 20.h,), + SizedBox( + height: 30.h, + ), + Image.asset( + 'images/main/icon_main_addLock.png', + width: 150.w, + height: 150.w, + color: AppColors.mainColor, + ), + SizedBox( + height: 20.h, + ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text("发送成功",style: TextStyle(fontSize: 32.sp, color: Colors.black, fontWeight: FontWeight.w500),), + Text( + "发送成功", + style: TextStyle( + fontSize: 32.sp, + color: Colors.black, + fontWeight: FontWeight.w500), + ), ], ), ], ), ), - SizedBox(height: 20.h,), - SubmitBtn(btnName: '完成', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - - }), - SubmitBtn(btnName: '邮件通知', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - Navigator.pushNamed(context, Routers.sendEmailNotificationPage); - }), - SubmitBtn(btnName: '微信通知', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - - }), - SubmitBtn(btnName: '标记为已入住', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - - }), + SizedBox( + height: 20.h, + ), + SubmitBtn( + btnName: '完成', + fontSize: 28.sp, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), + SubmitBtn( + btnName: '邮件通知', + fontSize: 28.sp, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () { + Navigator.pushNamed(context, Routers.sendEmailNotificationPage); + }), + SubmitBtn( + btnName: '微信通知', + fontSize: 28.sp, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), + SubmitBtn( + btnName: '标记为已入住', + fontSize: 28.sp, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), ], ); } // 接受者信息输入框 - Widget getTFWidget(bool isHaveBtn, String tfStr){ + Widget getTFWidget(bool isHaveBtn, String tfStr) { return Container( height: 50.h, width: 500.w, child: Row( children: [ - Expanded( - child: TextField( + Expanded( + child: TextField( //输入框一行 maxLines: 1, // controller: _controller, autofocus: false, - textAlign:TextAlign.end, + textAlign: TextAlign.end, decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), @@ -233,45 +295,50 @@ class _SendElectronicKeyPageState extends State { //不需要输入框下划线 border: InputBorder.none, ), - ), - ), - SizedBox(width: 10.w,), - isHaveBtn?Container( - width: 50.w, - height: 50.w, - decoration: const BoxDecoration( - color: Colors.white, - image: DecorationImage( - image: AssetImage('images/icon_lock.png'), - fit: BoxFit.fill - ), ), - alignment: Alignment.center, - child: InkWell( - onTap: () async { - Contact? contact = await _contactPicker.selectContact(); - setState(() { - _contact = contact!; - // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}"); - }); - }, ), - ):Container() + SizedBox( + width: 10.w, + ), + isHaveBtn + ? Container( + width: 50.w, + height: 50.w, + decoration: const BoxDecoration( + color: Colors.white, + image: DecorationImage( + image: AssetImage('images/icon_lock.png'), + fit: BoxFit.fill), + ), + alignment: Alignment.center, + child: InkWell( + onTap: () async { + Contact? contact = await _contactPicker.selectContact(); + setState(() { + _contact = contact!; + // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}"); + }); + }, + ), + ) + : Container() ], ), ); } - Switch _switch(){ - return Switch( - value: false, - onChanged: (value){ - // switchValue = !switchValue; - setState(() { - - }); - } + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, ); } - } diff --git a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart index f3d743dc..8378e94f 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart @@ -1,6 +1,6 @@ - import 'dart:convert'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -25,35 +25,56 @@ class _AutomaticBlockingPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.automaticBlocking!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:ListView( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.automaticBlocking!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.automaticBlocking!.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), - Container(height: 10.h,), - Builder( - builder: (context) { - return CommonItem(leftTitel:TranslationLoader.lanKeys!.delayTime!.tr, rightTitle:"5s", isHaveLine: false, isHaveDirection: true, action: (){ - var list = ["5S", "10S", "15S", "30S", "60S", TranslationLoader.lanKeys!.custom!.tr]; - ShowBottomSheetTool().showSingleRowPicker( - //上下文 - context, - //默认的索引 - normalIndex: 2, - title: TranslationLoader.lanKeys!.time!.tr, - cancelTitle: TranslationLoader.lanKeys!.cancel!.tr, - sureTitle: TranslationLoader.lanKeys!.sure!.tr, - //要显示的列表 - //可自定义数据适配器 - //adapter: PickerAdapter(), - data: list, - //选择事件的回调 - clickCallBack: (int index, var str) { - - }); - }); - } + CommonItem( + leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr, + rightTitle: "", + isHaveLine: false, + isHaveRightWidget: true, + rightWidget: + Container(width: 80.w, height: 50.h, child: _switch())), + Container( + height: 10.h, + ), + Builder(builder: (context) { + return CommonItem( + leftTitel: TranslationLoader.lanKeys!.delayTime!.tr, + rightTitle: "5s", + isHaveLine: false, + isHaveDirection: true, + action: () { + var list = [ + "5S", + "10S", + "15S", + "30S", + "60S", + TranslationLoader.lanKeys!.custom!.tr + ]; + ShowBottomSheetTool().showSingleRowPicker( + //上下文 + context, + //默认的索引 + normalIndex: 2, + title: TranslationLoader.lanKeys!.time!.tr, + cancelTitle: TranslationLoader.lanKeys!.cancel!.tr, + sureTitle: TranslationLoader.lanKeys!.sure!.tr, + //要显示的列表 + //可自定义数据适配器 + //adapter: PickerAdapter(), + data: list, + //选择事件的回调 + clickCallBack: (int index, var str) {}); + }); + }), + Container( + height: 10.h, ), - Container(height: 10.h,), Visibility( visible: true, child: Container( @@ -62,7 +83,10 @@ class _AutomaticBlockingPageState extends State { child: Column( children: [ Row( - children: [Text("${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.time!.tr}(S)"),], + children: [ + Text( + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.time!.tr}(S)"), + ], ), TextField( //输入框一行 @@ -71,43 +95,49 @@ class _AutomaticBlockingPageState extends State { autofocus: false, decoration: InputDecoration( //输入里面输入文字内边距设置 - contentPadding: const EdgeInsets.only( - top: 12.0, bottom: 8.0), - hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.time!.tr}(S)", + contentPadding: + const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.time!.tr}(S)", hintStyle: TextStyle(fontSize: 30.sp), //不需要输入框下划线 border: InputBorder.none, ), ), - Container(height: 0.5.h, color: Colors.grey,), + Container( + height: 0.5.h, + color: Colors.grey, + ), ], ), - ) - ), + )), Container( padding: EdgeInsets.all(30.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text(TranslationLoader.lanKeys!.automaticBlockingTip!.tr)), + Expanded( + child: Text( + TranslationLoader.lanKeys!.automaticBlockingTip!.tr)), ], ), ) ], - ) - ); + )); } - Switch _switch(){ - return Switch( - value: false, - onChanged: (value){ - // switchValue = !switchValue; - setState(() { - - }); - } + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, ); } - } diff --git a/star_lock/lib/main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_page.dart b/star_lock/lib/main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_page.dart index a62e92f9..5ecce6f0 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_page.dart @@ -59,7 +59,7 @@ class _ImportOtherLockDataPageState extends State { Widget _searchWidget() { return Container( height: 60.h, - // margin: EdgeInsets.only(top:20.w), + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5)), child: TextField( @@ -67,17 +67,19 @@ class _ImportOtherLockDataPageState extends State { maxLines: 1, // controller: _controller, autofocus: false, + decoration: InputDecoration( //输入里面输入文字内边距设置 - contentPadding: EdgeInsets.only( - top: 8.h, left: -25.0.h, right: -15.0.h, bottom: 8.0.h), + contentPadding: const EdgeInsets.only( + top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart index 78293a6c..84c9e4fb 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart @@ -1,4 +1,4 @@ - +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -22,100 +22,227 @@ class _LockSetPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.set!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:Column( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.set!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Column( children: [ Expanded( child: ListView( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.basicInformation!.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.basicInformationPage); - }), - SizedBox(height: 10.h,), - CommonItem(leftTitel:TranslationLoader.lanKeys!.wirelessKeyboard!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.wirelessKeyboardPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.doorMagnetic!.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.doorMagneticPage); - }), - SizedBox(height: 10.h,), - CommonItem(leftTitel:TranslationLoader.lanKeys!.remoteUnlocking!.tr, rightTitle:TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.remoteUnlockingPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.automaticBlocking!.tr, rightTitle:"5s", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.automaticBlockingPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.normallyOpenMode!.tr, rightTitle:TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.normallyOpenModePage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.lockSound!.tr, rightTitle:"高", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.lockSoundSetPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.burglarAlarm!.tr, rightTitle:TranslationLoader.lanKeys!.opened!.tr, isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.burglarAlarmPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.resetButton!.tr, rightTitle:TranslationLoader.lanKeys!.opened!.tr, isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.resetButtonPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.unlockQRCode!.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.unlockQRCodePage); - }), - SizedBox(height: 10.h,), - CommonItem(leftTitel:TranslationLoader.lanKeys!.lockTime!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.lockTimePage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.diagnose!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.diagnosePage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.uploadData!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.uploadDataPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.importOtherLockData!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.importOtherLockDataPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.lockEscalation!.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.lockEscalationPage); - }), - SizedBox(height: 10.h,), - CommonItem(leftTitel:"Amazon Alexa", rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - - }), - CommonItem(leftTitel:"Google Home", rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - - }), - SizedBox(height: 10.h,), - CommonItem(leftTitel:TranslationLoader.lanKeys!.markedHouseState!.tr, rightTitle:"空闲", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.markedHouseStatePage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.checkingIn!.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), - CommonItem(leftTitel:TranslationLoader.lanKeys!.unlockReminder!.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), - SizedBox(height: 30.h,), - SubmitBtn(btnName: TranslationLoader.lanKeys!.delete!.tr, - borderRadius: 20.w, - fontSize: 32.sp, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), - padding: EdgeInsets.only(top: 20.w, bottom: 20.w), - onClick: () { - - } + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.basicInformation!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.basicInformationPage); + }), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.wirelessKeyboard!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.wirelessKeyboardPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.doorMagneticPage); + }), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr, + rightTitle: TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.remoteUnlockingPage); + }), + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.automaticBlocking!.tr, + rightTitle: "5s", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.automaticBlockingPage); + }), + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.normallyOpenMode!.tr, + rightTitle: TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.normallyOpenModePage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.lockSound!.tr, + rightTitle: "高", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.lockSoundSetPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr, + rightTitle: TranslationLoader.lanKeys!.opened!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.burglarAlarmPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.resetButton!.tr, + rightTitle: TranslationLoader.lanKeys!.opened!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.resetButtonPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.unlockQRCode!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.unlockQRCodePage); + }), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.lockTime!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.lockTimePage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.diagnose!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.diagnosePage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.uploadData!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.uploadDataPage); + }), + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.importOtherLockData!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.importOtherLockDataPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.lockEscalation!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.lockEscalationPage); + }), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: "Amazon Alexa", + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: "Google Home", + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () {}), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.markedHouseState!.tr, + rightTitle: "空闲", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.markedHouseStatePage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: Container( + width: 80.w, height: 50.h, child: _switch())), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr, + rightTitle: "", + isHaveLine: false, + isHaveRightWidget: true, + rightWidget: Container( + width: 80.w, height: 50.h, child: _switch())), + SizedBox( + height: 30.h, + ), + Container( + padding: EdgeInsets.only(left: 20.w, right: 20.w), + child: SubmitBtn( + btnName: TranslationLoader.lanKeys!.delete!.tr, + isDelete: true, + onClick: () {}), ), ], ), ), ], - ) - ); + )); } - Switch _switch(){ - return Switch( - value: false, - onChanged: (value){ - // switchValue = !switchValue; - setState(() { - - }); - } + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, ); } } diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart index 1b7102d3..f11735e8 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart @@ -1,4 +1,4 @@ - +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -17,97 +17,163 @@ class LockSoundSetPage extends StatefulWidget { } class _LockSoundSetPageState extends State { - @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.lockSound!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:ListView( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.lockSound!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.lockSound!.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), - Container(height: 10.h,), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.lockSound!.tr, + rightTitle: "", + isHaveLine: false, + isHaveRightWidget: true, + rightWidget: + Container(width: 80.w, height: 50.h, child: _switch())), + Container( + height: 10.h, + ), Container( padding: EdgeInsets.all(30.w), color: Colors.white, child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text(TranslationLoader.lanKeys!.lockSoundTip!.tr)), + Expanded( + child: Text(TranslationLoader.lanKeys!.lockSoundTip!.tr)), ], ), ), - SizedBox(height: 10.h,), + SizedBox( + height: 10.h, + ), Visibility( visible: true, child: Container( color: Colors.white, child: Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.pleaseSeletLockVolume!.tr, rightTitle:"", isHaveLine: true), - CommonItem(leftTitel:TranslationLoader.lanKeys!.low!.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + CommonItem( + leftTitel: TranslationLoader + .lanKeys!.pleaseSeletLockVolume!.tr, + rightTitle: "", + isHaveLine: true), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.low!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, rightWidget: GestureDetector( - onTap: (){ - - }, - child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) - ), - CommonItem(leftTitel:TranslationLoader.lanKeys!.lower!.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + onTap: () {}, + child: Row( + children: [ + Image.asset( + 'images/icon_round_unSelet.png', + width: 40.w, + height: 40.w, + ), + ], + ), + )), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.lower!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, rightWidget: GestureDetector( - onTap: (){ - - }, - child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) - ), - CommonItem(leftTitel:TranslationLoader.lanKeys!.medium!.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + onTap: () {}, + child: Row( + children: [ + Image.asset( + 'images/icon_round_unSelet.png', + width: 40.w, + height: 40.w, + ), + ], + ), + )), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.medium!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, rightWidget: GestureDetector( - onTap: (){ - - }, - child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) - ), - CommonItem(leftTitel:TranslationLoader.lanKeys!.higher!.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + onTap: () {}, + child: Row( + children: [ + Image.asset( + 'images/icon_round_unSelet.png', + width: 40.w, + height: 40.w, + ), + ], + ), + )), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.higher!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, rightWidget: GestureDetector( - onTap: (){ - - }, - child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) - ), - CommonItem(leftTitel:TranslationLoader.lanKeys!.high!.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, + onTap: () {}, + child: Row( + children: [ + Image.asset( + 'images/icon_round_unSelet.png', + width: 40.w, + height: 40.w, + ), + ], + ), + )), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.high!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, rightWidget: GestureDetector( - onTap: (){ - - }, - child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) - ), + onTap: () {}, + child: Row( + children: [ + Image.asset( + 'images/icon_round_unSelet.png', + width: 40.w, + height: 40.w, + ), + ], + ), + )), ], ), - ) - ), + )), SubmitBtn( btnName: TranslationLoader.lanKeys!.save!.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ + onClick: () { // Navigator.pushNamed(context, Routers.nearbyLockPage); - } - ), + }), ], - ) - ); + )); } - Switch _switch(){ - return Switch( - value: false, - onChanged: (value){ - // switchValue = !switchValue; - setState(() { - - }); - } + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, ); } - } diff --git a/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart b/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart index 3962352e..805b157b 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart @@ -1,4 +1,4 @@ - +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -17,27 +17,41 @@ class NormallyOpenModePage extends StatefulWidget { } class _NormallyOpenModePageState extends State { - @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.normallyOpenMode!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:ListView( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.normallyOpenMode!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.normallyOpenMode!.tr, rightTitle:"", isHaveLine: false, isHaveRightWidget:true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch())), - Container(height: 10.h,), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr, + rightTitle: "", + isHaveLine: false, + isHaveRightWidget: true, + rightWidget: + Container(width: 80.w, height: 50.h, child: _switch())), + Container( + height: 10.h, + ), Container( padding: EdgeInsets.all(30.w), color: Colors.white, child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text(TranslationLoader.lanKeys!.normallyOpenModeTip!.tr)), + Expanded( + child: Text( + TranslationLoader.lanKeys!.normallyOpenModeTip!.tr)), ], ), ), - SizedBox(height: 10.h,), + SizedBox( + height: 10.h, + ), Visibility( visible: true, child: Container( @@ -45,27 +59,26 @@ class _NormallyOpenModePageState extends State { child: Column( children: [ topWidget(), - SizedBox(height: 10.h,), + SizedBox( + height: 10.h, + ), bottomWidget() ], ), - ) - ), + )), SubmitBtn( btnName: TranslationLoader.lanKeys!.save!.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ + onClick: () { // Navigator.pushNamed(context, Routers.nearbyLockPage); - } - ), + }), ], - ) - ); + )); } - Widget topWidget(){ + Widget topWidget() { return Container( height: 150.h, width: 1.sw, @@ -76,29 +89,28 @@ class _NormallyOpenModePageState extends State { Container( height: 60.h, // color: Colors.red, - padding: EdgeInsets.only(left:20.h, top: 15.h), - child: Text("${TranslationLoader.lanKeys!.normallyOpen!.tr} ${TranslationLoader.lanKeys!.date!.tr}", style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w600)) - ), + padding: EdgeInsets.only(left: 20.h, top: 15.h), + child: Text( + "${TranslationLoader.lanKeys!.normallyOpen!.tr} ${TranslationLoader.lanKeys!.date!.tr}", + style: + TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w600))), Container( height: 90.h, - padding: EdgeInsets.only(left:10.w, right: 10.w), + padding: EdgeInsets.only(left: 10.w, right: 10.w), child: GridView.builder( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 7, - childAspectRatio: 1.0 - ), + crossAxisCount: 7, childAspectRatio: 1.0), itemCount: 7, physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context,index){ + itemBuilder: (context, index) { return btnItem(index); - }) - ), + })), ], ), ); } - Widget btnItem(int index){ + Widget btnItem(int index) { String dateStr; switch (index) { case 0: @@ -127,9 +139,7 @@ class _NormallyOpenModePageState extends State { break; } return GestureDetector( - onTap: (){ - - }, + onTap: () {}, child: Container( width: 70.h, height: 70.h, @@ -144,55 +154,74 @@ class _NormallyOpenModePageState extends State { ); } - Widget bottomWidget(){ + Widget bottomWidget() { return Column( children: [ - Container(color: AppColors.mainBackgroundColor, height: 10.h,), - CommonItem(leftTitel:"${TranslationLoader.lanKeys!.normallyOpen!.tr} ${TranslationLoader.lanKeys!.time!.tr}", rightTitle:"", isHaveLine: true, isHaveRightWidget: true, - rightWidget: GestureDetector( - onTap: (){ - - }, - child: Row( - children: [ - Text(TranslationLoader.lanKeys!.allDay!.tr), - SizedBox(width: 5.w,), - Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,), - ], - ), - )), + Container( + color: AppColors.mainBackgroundColor, + height: 10.h, + ), + CommonItem( + leftTitel: + "${TranslationLoader.lanKeys!.normallyOpen!.tr} ${TranslationLoader.lanKeys!.time!.tr}", + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: () {}, + child: Row( + children: [ + Text(TranslationLoader.lanKeys!.allDay!.tr), + SizedBox( + width: 5.w, + ), + Image.asset( + 'images/icon_round_unSelet.png', + width: 40.w, + height: 40.w, + ), + ], + ), + )), Visibility( visible: true, child: Container( color: Colors.white, child: Column( children: [ - CommonItem(leftTitel:"${TranslationLoader.lanKeys!.begin!.tr} ${TranslationLoader.lanKeys!.time!.tr}", rightTitle:"", isHaveDirection: true, isHaveLine: true, action:(){ - - }), - CommonItem(leftTitel:"${TranslationLoader.lanKeys!.end!.tr} ${TranslationLoader.lanKeys!.time!.tr}", rightTitle:"", isHaveDirection: true, action:(){ - - }), + CommonItem( + leftTitel: + "${TranslationLoader.lanKeys!.begin!.tr} ${TranslationLoader.lanKeys!.time!.tr}", + rightTitle: "", + isHaveDirection: true, + isHaveLine: true, + action: () {}), + CommonItem( + leftTitel: + "${TranslationLoader.lanKeys!.end!.tr} ${TranslationLoader.lanKeys!.time!.tr}", + rightTitle: "", + isHaveDirection: true, + action: () {}), Container(height: 10.h), ], ), - ) - ), - + )), ], ); } - Switch _switch(){ - return Switch( - value: false, - onChanged: (value){ - // switchValue = !switchValue; - setState(() { - - }); - } + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, ); } - } diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index eec1a81b..670c7a61 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -32,7 +32,7 @@ class _LockDetailPageState extends State { Widget topWidget() { return Column( children: [ - SizedBox(height: 40.h), + SizedBox(height: 30.h), Stack( alignment: Alignment.centerRight, children: [ @@ -41,48 +41,49 @@ class _LockDetailPageState extends State { child: Text( "MCBN01-ea9240", style: - TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w500), + TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400), )), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Text( "100%", - style: - TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), + style: TextStyle( + fontSize: 18.sp, color: AppColors.darkGrayTextColor), ), - SizedBox(width: 5.w), + SizedBox(width: 2.w), Image.asset( 'images/main/icon_main_cell.png', - width: 50.w, - height: 50.w, + width: 30.w, + height: 24.w, ), SizedBox(width: 30.w), ], ), ], ), - SizedBox(height: 40.h), + SizedBox(height: 30.h), Container( - width: 1.sw, + // width: 1.sw, + color: Colors.white, height: 280.w, child: Stack( children: [ Center( child: Image.asset('images/main/icon_main_openLockBtn.png', - width: 280.w, height: 280.w)), + width: 268.w, height: 268.w)), Align( - alignment: const Alignment(0.5, 1), + alignment: const Alignment(0.6, 1), child: Image.asset( 'images/main/icon_main_remoteUnlocking.png', - width: 90.w, - height: 90.w, + width: 50.w, + height: 52.w, )), ], ), ), SizedBox( - height: 40.h, + height: 30.h, ), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -90,18 +91,18 @@ class _LockDetailPageState extends State { Text( TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr, style: TextStyle( - fontSize: 24.sp, + fontSize: 20.sp, color: const Color(0xFFB3B3B3), fontWeight: FontWeight.w500), ), ], ), SizedBox( - height: 40.h, + height: 30.h, ), Divider( height: 1, - color: const Color(0xFFB3B3B3), + color: AppColors.greyLineColor, indent: 20.w, endIndent: 20.w, ) @@ -111,14 +112,14 @@ class _LockDetailPageState extends State { Widget bottomWidget() { return Container( - margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 25.h), + margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 40.h), // color: Colors.blue, child: SizedBox( child: GridView.count( crossAxisCount: 4, // childAspectRatio: 3, crossAxisSpacing: 20.w, - mainAxisSpacing: 10.h, + mainAxisSpacing: 0.h, physics: const NeverScrollableScrollPhysics(), children: [ bottomItem('images/main/icon_main_clockingIn.png', @@ -167,8 +168,8 @@ class _LockDetailPageState extends State { } Widget bottomItem(String iconUrl, String name, Function() onClick) { - var width = 65.w; - var height = 70.h; + var width = 40.w; + var height = 36.h; return GestureDetector( onTap: onClick, child: Container( @@ -183,11 +184,11 @@ class _LockDetailPageState extends State { child: Image.asset(iconUrl, width: width, height: height, fit: BoxFit.fitWidth), ), - SizedBox(height: 15.w), + SizedBox(height: 10.w), Expanded( child: Text(name, style: TextStyle( - fontSize: 25.sp, color: const Color(0xff333333)), + fontSize: 20.sp, color: AppColors.blackColor), textAlign: TextAlign.center)) ], )), diff --git a/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart b/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart index 83ae0f5e..06924cd6 100644 --- a/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart +++ b/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart @@ -67,7 +67,7 @@ class _LockOperatingRecordPageState extends State { Widget _searchWidget() { return Container( height: 60.h, - margin: EdgeInsets.only(left: 20.w, right: 20.w), + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5)), child: TextField( @@ -75,18 +75,19 @@ class _LockOperatingRecordPageState extends State { maxLines: 1, // controller: _controller, autofocus: false, + decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only( - top: 12.0, left: -22.0, right: -15.0, bottom: 10.0), + top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, - hintStyle: TextStyle(fontSize: 28.sp), + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart index 0a37848f..12de22c9 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart @@ -24,51 +24,78 @@ class _OtherTypeKeyDetailPageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}", haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ - TextButton( - child: Text(TranslationLoader.lanKeys!.share!.tr, style: const TextStyle(color: Colors.white),), - onPressed: (){ - - },), - ],), + appBar: TitleAppBar( + barTitle: + "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}", + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.share!.tr, + style: const TextStyle(color: Colors.white), + ), + onPressed: () {}, + ), + ], + ), body: Column( children: [ - CommonItem(leftTitel:"${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}", rightTitle:"98765432", isHaveDirection: true, isHaveLine: true, action:(){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.name!.tr, rightTitle:"你好", isHaveDirection: true, isHaveLine: true, action:(){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.periodValidity!.tr, rightTitle:"永久", isHaveDirection: true, action:(){ - Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); - }), + CommonItem( + leftTitel: + "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}", + rightTitle: "98765432", + isHaveDirection: true, + isHaveLine: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: "你好", + isHaveDirection: true, + isHaveLine: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, + rightTitle: "永久", + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.electronicKeyDetailChangeDate); + }), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.additive!.tr, rightTitle:"15080825640", action:(){ - - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.addTime!.tr, rightTitle:"2020.06.21 11:49", action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.additive!.tr, + rightTitle: "15080825640", + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.addTime!.tr, + rightTitle: "2020.06.21 11:49", + action: () {}), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.operatingRecord!.tr, rightTitle:"", isHaveDirection: true, action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, + rightTitle: "", + isHaveDirection: true, + action: () {}), Container(height: 40.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, + isDelete: true, borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + margin: EdgeInsets.only( + left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ - - } - ), + onClick: () {}), ], ), ); } - String getAppBarTitle(int type){ + String getAppBarTitle(int type) { String title = ""; switch (type) { case 0: @@ -86,7 +113,12 @@ class _OtherTypeKeyDetailPageState extends State { return title; } - Widget commonItem(String leftTitle, String rightTitle, {bool isHaveDirection = false, bool isHaveLine = false, bool isHaveRightWidget = false, Widget? rightWidget, Function()? action}){ + Widget commonItem(String leftTitle, String rightTitle, + {bool isHaveDirection = false, + bool isHaveLine = false, + bool isHaveRightWidget = false, + Widget? rightWidget, + Function()? action}) { return GestureDetector( onTap: action, child: Column( @@ -95,27 +127,50 @@ class _OtherTypeKeyDetailPageState extends State { Container( // height: 80.h, color: Colors.white, - padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + padding: EdgeInsets.only( + left: 20.w, right: 10.w, top: 20.w, bottom: 20.w), child: Row( children: [ - SizedBox(width:20.w), - Text(leftTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), - SizedBox(width:20.w), + SizedBox(width: 20.w), + Text( + leftTitle, + style: + TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), + ), + SizedBox(width: 20.w), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - isHaveRightWidget?rightWidget!:Text(rightTitle, textAlign: TextAlign.end,style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + isHaveRightWidget + ? rightWidget! + : Text( + rightTitle, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 28.sp, fontWeight: FontWeight.w500), + ) ], ), ), - SizedBox(width:5.w), - isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + SizedBox(width: 5.w), + isHaveDirection + ? Image.asset( + 'images/icon_right.png', + width: 50.w, + height: 50.w, + ) + : SizedBox(width: 10.w), // SizedBox(width:10.w), ], ), ), - isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + isHaveLine + ? Container( + height: 0.5.h, + color: Colors.grey, + ) + : Container() ], ), ); @@ -131,7 +186,9 @@ class _OtherTypeKeyDetailPageState extends State { title: const Text("修改密码"), content: Column( children: [ - const SizedBox(height: 10,), + const SizedBox( + height: 10, + ), Container( height: 80.h, // color: Colors.white, @@ -191,5 +248,4 @@ class _OtherTypeKeyDetailPageState extends State { ); }); } - } diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart index ec538074..c745a7a5 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart @@ -76,7 +76,7 @@ class _OtherTypeKeyListPageState extends State { Widget _searchWidget() { return Container( height: 60.h, - margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w), + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5)), child: TextField( @@ -84,17 +84,19 @@ class _OtherTypeKeyListPageState extends State { maxLines: 1, // controller: _controller, autofocus: false, + decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only( top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart index fa178d0c..9d18d11c 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -22,51 +22,81 @@ class _PasswordKeyDetailPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.passwordDetail!.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ - TextButton( - child: const Text("分享", style: TextStyle(color: Colors.white),), - onPressed: (){ - - },), - ],), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.passwordDetail!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + child: const Text( + "分享", + style: TextStyle(color: Colors.white), + ), + onPressed: () {}, + ), + ], + ), body: Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.password!.tr, rightTitle:"98765432", isHaveDirection: true, isHaveLine: true, action:(){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.name!.tr, rightTitle:"你好", isHaveDirection: true, isHaveLine: true, action:(){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, rightTitle:"永久", isHaveDirection: true, action:(){ - Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.password!.tr, + rightTitle: "98765432", + isHaveDirection: true, + isHaveLine: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: "你好", + isHaveDirection: true, + isHaveLine: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + rightTitle: "永久", + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.electronicKeyDetailChangeDate); + }), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.sender!.tr, rightTitle:"15080825640", action:(){ - - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.senderTime!.tr, rightTitle:"2020.06.21 11:49", action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.sender!.tr, + rightTitle: "15080825640", + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.senderTime!.tr, + rightTitle: "2020.06.21 11:49", + action: () {}), Container(height: 10.h), - CommonItem(leftTitel:TranslationLoader.lanKeys!.operatingRecord!.tr, rightTitle:"", isHaveDirection: true, action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, + rightTitle: "", + isHaveDirection: true, + action: () {}), Container(height: 40.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, + isDelete: true, borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), + margin: EdgeInsets.only( + left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ - - } - ), + onClick: () {}), ], ), ); } - Widget commonItem(String leftTitle, String rightTitle, {bool isHaveDirection = false, bool isHaveLine = false, bool isHaveRightWidget = false, Widget? rightWidget, Function()? action}){ + Widget commonItem(String leftTitle, String rightTitle, + {bool isHaveDirection = false, + bool isHaveLine = false, + bool isHaveRightWidget = false, + Widget? rightWidget, + Function()? action}) { return GestureDetector( onTap: action, child: Column( @@ -75,27 +105,50 @@ class _PasswordKeyDetailPageState extends State { Container( // height: 80.h, color: Colors.white, - padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), + padding: EdgeInsets.only( + left: 20.w, right: 10.w, top: 20.w, bottom: 20.w), child: Row( children: [ - SizedBox(width:20.w), - Text(leftTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), - SizedBox(width:20.w), + SizedBox(width: 20.w), + Text( + leftTitle, + style: + TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), + ), + SizedBox(width: 20.w), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - isHaveRightWidget?rightWidget!:Text(rightTitle, textAlign: TextAlign.end,style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),) + isHaveRightWidget + ? rightWidget! + : Text( + rightTitle, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 28.sp, fontWeight: FontWeight.w500), + ) ], ), ), - SizedBox(width:5.w), - isHaveDirection?Image.asset('images/icon_right.png', width: 50.w, height: 50.w,):SizedBox(width:10.w), + SizedBox(width: 5.w), + isHaveDirection + ? Image.asset( + 'images/icon_right.png', + width: 50.w, + height: 50.w, + ) + : SizedBox(width: 10.w), // SizedBox(width:10.w), ], ), ), - isHaveLine?Container(height: 0.5.h, color: Colors.grey,):Container() + isHaveLine + ? Container( + height: 0.5.h, + color: Colors.grey, + ) + : Container() ], ), ); @@ -108,10 +161,13 @@ class _PasswordKeyDetailPageState extends State { return Card( color: const Color(0x00FFFFFF), child: CupertinoAlertDialog( - title: Text("${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.password!.tr}"), + title: Text( + "${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.password!.tr}"), content: Column( children: [ - const SizedBox(height: 10,), + const SizedBox( + height: 10, + ), Container( height: 80.h, // color: Colors.white, @@ -171,5 +227,4 @@ class _PasswordKeyDetailPageState extends State { ); }); } - } diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart index b1b742ca..e2d59d7a 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart @@ -55,7 +55,7 @@ class _PasswordKeyListPageState extends State { Widget _searchWidget() { return Container( height: 60.h, - margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w), + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5)), child: TextField( @@ -63,17 +63,19 @@ class _PasswordKeyListPageState extends State { maxLines: 1, // controller: _controller, autofocus: false, + decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only( top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart index 411f7224..3c9cb002 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_page.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -11,13 +12,14 @@ import '../../../../translations/trans_lib.dart'; class PasswordKeyPerpetualPage extends StatefulWidget { final String type; - const PasswordKeyPerpetualPage({Key? key, required this.type}) : super(key: key); + const PasswordKeyPerpetualPage({Key? key, required this.type}) + : super(key: key); @override - State createState() => _PasswordKeyPerpetualPageState(); + State createState() => + _PasswordKeyPerpetualPageState(); } class _PasswordKeyPerpetualPageState extends State { - final TextEditingController _controller = TextEditingController(); @override @@ -29,10 +31,9 @@ class _PasswordKeyPerpetualPageState extends State { void initState() { // TODO: implement initState super.initState(); - } - Widget indexChangeWidget(){ + Widget indexChangeWidget() { switch (int.parse(widget.type)) { case 0: { @@ -40,7 +41,10 @@ class _PasswordKeyPerpetualPageState extends State { // return sendElectronicKeySucceed(); return Column( children: [ - perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, _controller), + perpetualKeyWidget( + TranslationLoader.lanKeys!.name!.tr, + TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, + _controller), keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip1!.tr) ], ); @@ -52,7 +56,10 @@ class _PasswordKeyPerpetualPageState extends State { return Column( children: [ keyTimeLimitWidget(), - perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, _controller), + perpetualKeyWidget( + TranslationLoader.lanKeys!.name!.tr, + TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, + _controller), keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip2!.tr) ], ); @@ -63,7 +70,10 @@ class _PasswordKeyPerpetualPageState extends State { // 单次 return Column( children: [ - perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, _controller), + perpetualKeyWidget( + TranslationLoader.lanKeys!.name!.tr, + TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, + _controller), keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip3!.tr) ], ); @@ -75,8 +85,12 @@ class _PasswordKeyPerpetualPageState extends State { return Column( children: [ keyIfPerpetualWidget(), - perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, _controller), - perpetualKeyWidget(TranslationLoader.lanKeys!.password!.tr, "请输入6-9位数字", _controller), + perpetualKeyWidget( + TranslationLoader.lanKeys!.name!.tr, + TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, + _controller), + perpetualKeyWidget(TranslationLoader.lanKeys!.password!.tr, + "请输入6-9位数字", _controller), keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip4!.tr) ], ); @@ -88,7 +102,10 @@ class _PasswordKeyPerpetualPageState extends State { return Column( children: [ keyCirculationWidget(), - perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, _controller), + perpetualKeyWidget( + TranslationLoader.lanKeys!.name!.tr, + TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, + _controller), keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip5!.tr) ], ); @@ -99,7 +116,10 @@ class _PasswordKeyPerpetualPageState extends State { // 清空 return Column( children: [ - perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, _controller), + perpetualKeyWidget( + TranslationLoader.lanKeys!.name!.tr, + TranslationLoader.lanKeys!.pleaseNameYourPassword!.tr, + _controller), keyBottomWidget(TranslationLoader.lanKeys!.getPasswordTip6!.tr) ], ); @@ -112,61 +132,86 @@ class _PasswordKeyPerpetualPageState extends State { } // 密码命名输入框 - Widget perpetualKeyWidget(String titleStr, String rightTitle, TextEditingController controller){ + Widget perpetualKeyWidget( + String titleStr, String rightTitle, TextEditingController controller) { return Column( children: [ Container(height: 10.h), - CommonItem(leftTitel:titleStr, rightTitle:"", isHaveRightWidget: true, rightWidget: getTFWidget(rightTitle)), + CommonItem( + leftTitel: titleStr, + rightTitle: "", + isHaveRightWidget: true, + rightWidget: getTFWidget(rightTitle)), Container(height: 10.h), ], ); } // 限时顶部选择日期 - Widget keyTimeLimitWidget(){ + Widget keyTimeLimitWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, rightTitle:"2020.06.20 11:49", isHaveLine: true, isHaveDirection: true, action:(){ - // _showDatePicker(); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.failureTime!.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ - // _showDatePicker(); - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveLine: true, + isHaveDirection: true, + action: () { + // _showDatePicker(); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveDirection: true, + action: () { + // _showDatePicker(); + }), Container(height: 10.h), ], ); } // 自定义是否永久 - Widget keyIfPerpetualWidget(){ + Widget keyIfPerpetualWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.permanent!.tr, rightTitle:"", isHaveRightWidget: true, rightWidget: Container(width: 80.w, height: 50.h,child: _switch()), action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.permanent!.tr, + rightTitle: "", + isHaveRightWidget: true, + rightWidget: Container(width: 80.w, height: 50.h, child: _switch()), + action: () {}), Container(height: 10.h), ], ); } // 循环 - Widget keyCirculationWidget(){ + Widget keyCirculationWidget() { return Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.recursiveDevice!.tr, rightTitle:"周末", isHaveLine: true, isHaveDirection: true, action:(){ - - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, rightTitle:"10:00", isHaveLine: true, isHaveDirection: true, action:(){ - - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.failureTime!.tr, rightTitle:"11:00", isHaveDirection: true, action:(){ - - }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.recursiveDevice!.tr, + rightTitle: "周末", + isHaveLine: true, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + rightTitle: "10:00", + isHaveLine: true, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, + rightTitle: "11:00", + isHaveDirection: true, + action: () {}), ], ); } - Widget keyBottomWidget(String tipStr){ + Widget keyBottomWidget(String tipStr) { return Column( children: [ Container( @@ -174,21 +219,26 @@ class _PasswordKeyPerpetualPageState extends State { child: Row( // crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded(child: Text(tipStr, textAlign: TextAlign.start,)), + Expanded( + child: Text( + tipStr, + textAlign: TextAlign.start, + )), ], ), ), - SubmitBtn(btnName: TranslationLoader.lanKeys!.getPassword!.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: (){ - - } - ), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.getPassword!.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), ], ); } // 发送电子钥匙成功 - Widget sendElectronicKeySucceed(){ + Widget sendElectronicKeySucceed() { return Column( children: [ Container( @@ -197,31 +247,70 @@ class _PasswordKeyPerpetualPageState extends State { color: Colors.white, child: Column( children: [ - SizedBox(height: 30.h,), - Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w, color: AppColors.mainColor,), - SizedBox(height: 20.h,), - Text("操作成功,密码为",style: TextStyle(fontSize: 32.sp, color: Colors.black, fontWeight: FontWeight.w500),), - SizedBox(height: 10.h,), - Text("62689876",style: TextStyle(fontSize: 60.sp, color: Colors.black, fontWeight: FontWeight.w500),), + SizedBox( + height: 30.h, + ), + Image.asset( + 'images/main/icon_main_addLock.png', + width: 150.w, + height: 150.w, + color: AppColors.mainColor, + ), + SizedBox( + height: 20.h, + ), + Text( + "操作成功,密码为", + style: TextStyle( + fontSize: 32.sp, + color: Colors.black, + fontWeight: FontWeight.w500), + ), + SizedBox( + height: 10.h, + ), + Text( + "62689876", + style: TextStyle( + fontSize: 60.sp, + color: Colors.black, + fontWeight: FontWeight.w500), + ), ], ), ), - SizedBox(height: 20.h,), - SubmitBtn(btnName: '完成', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - - }), - SubmitBtn(btnName: '分享', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - Navigator.pushNamed(context, Routers.sendEmailNotificationPage); - }), - SubmitBtn(btnName: '标记为:已入住', fontSize: 28.sp, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - - }), + SizedBox( + height: 20.h, + ), + SubmitBtn( + btnName: '完成', + fontSize: 28.sp, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), + SubmitBtn( + btnName: '分享', + fontSize: 28.sp, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () { + Navigator.pushNamed(context, Routers.sendEmailNotificationPage); + }), + SubmitBtn( + btnName: '标记为:已入住', + fontSize: 28.sp, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), ], ); } // 接受者信息输入框 - Widget getTFWidget(String tfStr){ + Widget getTFWidget(String tfStr) { return Container( height: 50.h, width: 500.w, @@ -233,7 +322,7 @@ class _PasswordKeyPerpetualPageState extends State { maxLines: 1, // controller: _controller, autofocus: false, - textAlign:TextAlign.end, + textAlign: TextAlign.end, decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), @@ -243,22 +332,26 @@ class _PasswordKeyPerpetualPageState extends State { ), ), ), - SizedBox(width: 10.w,), + SizedBox( + width: 10.w, + ), ], ), ); } - Switch _switch(){ - return Switch( - value: false, - onChanged: (value){ - // switchValue = !switchValue; - setState(() { - - }); - } + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, ); } - } diff --git a/star_lock/lib/main/lockMian/lockMain_page.dart b/star_lock/lib/main/lockMian/lockMain_page.dart index d385a814..9d7954b3 100644 --- a/star_lock/lib/main/lockMian/lockMain_page.dart +++ b/star_lock/lib/main/lockMian/lockMain_page.dart @@ -21,7 +21,7 @@ class StarLockMain extends StatefulWidget { State createState() => _StarLockMainState(); } -class _StarLockMainState extends State with BaseWidget{ +class _StarLockMainState extends State with BaseWidget { // final logic = Get.put(GetxBle()); StreamSubscription? _streamSubscription; @@ -41,21 +41,29 @@ class _StarLockMainState extends State with BaseWidget{ GetxBle.call.scanner.startScan([]); } - @override Widget build(BuildContext context) { return Scaffold( backgroundColor: const Color(0xFFF5F5F5), - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.starLock!.tr, haveBack:false, haveOtherLeftWidget: true, leftWidget: Builder( - builder: (context) => IconButton( - icon: Image.asset("images/main/mainLeft_menu_icon.png",color:Colors.white, width: 60.w, height: 60.w,), - onPressed: () { - Scaffold.of(context).openDrawer(); - }, - ) - ),backgroundColor: AppColors.mainColor), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.starLock!.tr, + haveBack: false, + haveOtherLeftWidget: true, + leftWidget: Builder( + builder: (context) => IconButton( + icon: Image.asset( + "images/main/mainLeft_menu_icon.png", + color: Colors.white, + width: 44.w, + height: 44.w, + ), + onPressed: () { + Scaffold.of(context).openDrawer(); + }, + )), + backgroundColor: AppColors.mainColor), drawer: Drawer( - width:1.sw/3*2, + width: 1.sw / 3 * 2, child: StarLockMinePage(), ), body: getLockList(), @@ -63,57 +71,75 @@ class _StarLockMainState extends State with BaseWidget{ ); } - Widget getLockList(){ + Widget getLockList() { return ListView.builder( - itemCount:10, - itemBuilder: (c, index){ - return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", (){ + itemCount: 10, + itemBuilder: (c, index) { + return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", () { Navigator.pushNamed(context, Routers.lockDetailPage); }); - } - ); + }); } - Widget nearbyLockItem(String lockTypeIcon, String lockTypeTitle, Function() action){ + Widget nearbyLockItem( + String lockTypeIcon, String lockTypeTitle, Function() action) { return GestureDetector( onTap: action, child: Container( - height: 150.h, + height: 122.h, margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), - decoration: BoxDecoration( + decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(20.w), ), child: Column( // mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox(height: 30.h,), + SizedBox( + height: 20.h, + ), Row( children: [ - SizedBox(width:20.w), - Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), - SizedBox(width:20.w), + SizedBox(width: 30.w), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + Text( + lockTypeTitle, + style: TextStyle( + fontSize: 24.sp, fontWeight: FontWeight.w500), + ), ], ), ), - SizedBox(width:20.w), - Text("100%", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ), - SizedBox(width:5.w), - Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), - SizedBox(width:30.w), + SizedBox(width: 20.w), + Text( + "100%", + style: TextStyle( + fontSize: 18.sp, color: AppColors.darkGrayTextColor), + ), + SizedBox(width: 2.w), + Image.asset( + 'images/main/icon_main_cell.png', + width: 30.w, + height: 24.w, + ), + SizedBox(width: 30.w), ], ), - SizedBox(height: 20.h,), + SizedBox( + height: 30.h, + ), Row( children: [ - SizedBox(width:30.w), - Text("永久/管理员", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + SizedBox(width: 30.w), + Text( + "永久/管理员", + style: TextStyle( + fontSize: 18.sp, color: AppColors.darkGrayTextColor), + ), ], ), ], @@ -122,7 +148,7 @@ class _StarLockMainState extends State with BaseWidget{ ); } - Widget unHaveData(){ + Widget unHaveData() { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -134,38 +160,46 @@ class _StarLockMainState extends State with BaseWidget{ border: Border.all(width: 4, color: AppColors.mainColor), borderRadius: BorderRadius.circular(75), ), - child:InkWell( + child: InkWell( child: Padding( padding: const EdgeInsets.all(30.0), - child: Image.asset('images/main/icon_main_addLock.png', width: 150.w, height: 150.w,), + child: Image.asset( + 'images/main/icon_main_addLock.png', + width: 150.w, + height: 150.w, + ), ), onTap: () { //实现回调函数 - Navigator.pushNamed(context, Routers.seletLockTypePage, - // arguments: { - // "url": ConstConfig.privacAgreementUrl, - // "title": '隐私政策' - // } + Navigator.pushNamed( + context, Routers.seletLockTypePage, + // arguments: { + // "url": ConstConfig.privacAgreementUrl, + // "title": '隐私政策' + // } ); }, - ) - ), + )), ], ), - SizedBox(height: h(50.h),), + SizedBox( + height: h(50.h), + ), Container( padding: EdgeInsets.all(30.w), - child: Text(TranslationLoader.lanKeys!.whenAddingLockThePhoneMustBeNextToTheLock!.tr, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w800, color: AppColors.mainColor),) - ) + child: Text( + TranslationLoader + .lanKeys!.whenAddingLockThePhoneMustBeNextToTheLock!.tr, + style: TextStyle( + fontSize: 30.sp, + fontWeight: FontWeight.w800, + color: AppColors.mainColor), + )) ], ); } - void onShow(){ + void onShow() {} - } - - void onHide(){ - - } + void onHide() {} } diff --git a/star_lock/lib/mine/about/about_page.dart b/star_lock/lib/mine/about/about_page.dart index cc3d47a4..2e15f739 100644 --- a/star_lock/lib/mine/about/about_page.dart +++ b/star_lock/lib/mine/about/about_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -20,23 +19,72 @@ class _AbountPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.about!.tr, haveBack:true, backgroundColor: AppColors.mainColor), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.about!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), body: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 150.h,), + SizedBox( + height: 150.h, + ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset("images/icon_main_1024.png", width: 200.w, height: 200.w,), + Image.asset( + "images/icon_main_1024.png", + width: 200.w, + height: 200.w, + ), ], ), - SizedBox(height: 30.h,), + SizedBox( + height: 30.h, + ), const Text("通通锁 6.7.0"), - SizedBox(height: 80.h,), - CommonItem(leftTitel:TranslationLoader.lanKeys!.introduce!.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ - - }), + SizedBox( + height: 80.h, + ), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.introduce!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.userAgreement!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.privacyPolicy!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: TranslationLoader + .lanKeys!.personalInformationCollectionList!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: TranslationLoader + .lanKeys!.applicationPermissionDescription!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: TranslationLoader + .lanKeys!.thirdPartyInformationSharingList!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () {}), ], ), ); diff --git a/star_lock/lib/mine/addLock/addLock/addLock_page.dart b/star_lock/lib/mine/addLock/addLock/addLock_page.dart index 6c8cd325..cd10b81f 100644 --- a/star_lock/lib/mine/addLock/addLock/addLock_page.dart +++ b/star_lock/lib/mine/addLock/addLock/addLock_page.dart @@ -37,7 +37,9 @@ class _AddLockPageState extends State with BaseWidget { children: [ Text( TranslationLoader.lanKeys!.lightTouchScreen!.tr, - style: TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w500), + style: TextStyle( + fontSize: 24.sp, + ), ), ], ), @@ -57,7 +59,7 @@ class _AddLockPageState extends State with BaseWidget { children: [ Text( TranslationLoader.lanKeys!.lightTouchScreenTip!.tr, - style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 20.sp, fontWeight: FontWeight.w500), ), ], ), diff --git a/star_lock/lib/mine/addLock/nearbyLock/nearbyLock_page.dart b/star_lock/lib/mine/addLock/nearbyLock/nearbyLock_page.dart index addf5cbd..ad7c8070 100644 --- a/star_lock/lib/mine/addLock/nearbyLock/nearbyLock_page.dart +++ b/star_lock/lib/mine/addLock/nearbyLock/nearbyLock_page.dart @@ -17,20 +17,24 @@ class _NearbyLockPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.nearbyLock!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body: ListView.builder( - itemCount:20, - itemBuilder: (c, index){ - return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", (){ - Navigator.pushNamed(context, Routers.lockAddressPage); - }); - } - ), + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.nearbyLock!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView.builder( + itemCount: 20, + itemBuilder: (c, index) { + return nearbyLockItem( + 'images/icon_lockGroup_item.png', "MCBN01-ea9240", () { + Navigator.pushNamed(context, Routers.lockAddressPage); + }); + }), ); } - Widget nearbyLockItem(String lockTypeIcon, String lockTypeTitle, Function() action){ + Widget nearbyLockItem( + String lockTypeIcon, String lockTypeTitle, Function() action) { return GestureDetector( onTap: action, child: Column( @@ -41,33 +45,52 @@ class _NearbyLockPageState extends State { color: Colors.white, child: Row( children: [ - SizedBox(width:20.w), - Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), - SizedBox(width:20.w), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), - ], - ), + SizedBox(width: 20.w), + Image.asset( + lockTypeIcon, + width: 50.w, + height: 50.w, ), - SizedBox(width:20.w), - Image.asset('images/main/icon_main_addLock.png', width: 50.w, height: 50.w,), - SizedBox(width:30.w), + SizedBox(width: 20.w), + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + lockTypeTitle, + style: TextStyle( + fontSize: 20.sp, color: AppColors.darkGrayTextColor), + ), + ], + ), + SizedBox( + width: 10.w, + ), + Image.asset( + "images/mine/icon_mine_main_about.png", + width: 22.w, + height: 22.w, + ), + Expanded(child: SizedBox(width: 20.w)), + Image.asset( + 'images/main/icon_main_addLock.png', + width: 28.w, + height: 28.w, + ), + SizedBox(width: 30.w), ], ), ), - Container(height: 0.5.h, color: Colors.grey,) + Container( + height: 0.5.h, + color: Colors.grey, + ) ], ), ); } - void onShow(){ - } + void onShow() {} - void onHide(){ - } + void onHide() {} } diff --git a/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart b/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart index 27c7af92..632e205f 100644 --- a/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart +++ b/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart @@ -32,7 +32,7 @@ class _SeletLockTypePageState extends State with BaseWidget { padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10), child: GridView.count( crossAxisCount: 2, - childAspectRatio: 3, + childAspectRatio: 2.83, crossAxisSpacing: 10, mainAxisSpacing: 10, children: [ @@ -48,22 +48,24 @@ class _SeletLockTypePageState extends State with BaseWidget { TranslationLoader.lanKeys!.safeLock!.tr, () { Navigator.pushNamed(context, Routers.addLockPage); }), - lockTypeItem( - 'images/lockType/lockType_intelligentLockCore.png', - TranslationLoader.lanKeys!.intelligentLockCore!.tr, () { - Navigator.pushNamed(context, Routers.addLockPage); - }), lockTypeItem('images/lockType/lockType_parkingLock.png', TranslationLoader.lanKeys!.parkingLock!.tr, () { Navigator.pushNamed(context, Routers.addLockPage); }), - lockTypeItem('images/lockType/lockType_bicycleLock.png', - TranslationLoader.lanKeys!.bicycleLock!.tr, () { + lockTypeItem( + 'images/lockType/lockType_intelligentLockCore.png', + TranslationLoader.lanKeys!.itelligentAccessControl!.tr, + () { Navigator.pushNamed(context, Routers.addLockPage); }), + + // lockTypeItem('images/lockType/lockType_bicycleLock.png', + // TranslationLoader.lanKeys!.bicycleLock!.tr, () { + // Navigator.pushNamed(context, Routers.addLockPage); + // }), lockTypeItem('images/lockType/lockType_remoteControl.png', - TranslationLoader.lanKeys!.longRangeControl!.tr, () { - Navigator.pushNamed(context, Routers.addLockPage); + TranslationLoader.lanKeys!.gateway!.tr, () { + Navigator.pushNamed(context, Routers.gatewayListPage); }), ], ), @@ -83,7 +85,7 @@ class _SeletLockTypePageState extends State with BaseWidget { margin: const EdgeInsets.all(10), child: Row( children: [ - SizedBox(width: 40.w), + SizedBox(width: 30.w), Image.asset( 'images/lockType/lockType_allLocks.png', width: 88.w, @@ -97,18 +99,19 @@ class _SeletLockTypePageState extends State with BaseWidget { children: [ Text(TranslationLoader.lanKeys!.allLock!.tr, style: TextStyle( - fontSize: 30.sp, fontWeight: FontWeight.w500)), + fontSize: 24.sp, + )), Text(TranslationLoader.lanKeys!.searchAllLockType!.tr, style: TextStyle( - fontSize: 26.sp, fontWeight: FontWeight.w500)), + fontSize: 20.sp, color: AppColors.darkGrayTextColor)), ], ), ), SizedBox(width: 40.w), Image.asset( - 'images/icon_right.png', - width: 60.w, - height: 60.w, + 'images/icon_right_grey.png', + width: 12.w, + height: 21.w, ), SizedBox(width: 40.w), ], @@ -127,11 +130,11 @@ class _SeletLockTypePageState extends State with BaseWidget { // margin: EdgeInsets.all(10), child: Row( children: [ - SizedBox(width: 20.w), + SizedBox(width: 30.w), Image.asset( lockTypeIcon, - width: 40.w, - height: 57.w, + width: 32.w, + height: 48.w, ), SizedBox(width: 20.w), Expanded( @@ -141,15 +144,15 @@ class _SeletLockTypePageState extends State with BaseWidget { children: [ Text(lockTypeTitle, style: TextStyle( - fontSize: 30.sp, fontWeight: FontWeight.w500)), + fontSize: 22.sp, color: AppColors.blackColor)), ], ), ), SizedBox(width: 20.w), Image.asset( - 'images/icon_right.png', - width: 60.w, - height: 60.w, + 'images/icon_right_grey.png', + width: 12.w, + height: 21.w, ), SizedBox(width: 20.w), ], diff --git a/star_lock/lib/mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart b/star_lock/lib/mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart index 67d7b5fe..f7b72ee7 100644 --- a/star_lock/lib/mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart +++ b/star_lock/lib/mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -12,10 +13,12 @@ class GatewayConfigurationWifiPage extends StatefulWidget { const GatewayConfigurationWifiPage({Key? key}) : super(key: key); @override - State createState() => _GatewayConfigurationWifiPageState(); + State createState() => + _GatewayConfigurationWifiPageState(); } -class _GatewayConfigurationWifiPageState extends State { +class _GatewayConfigurationWifiPageState + extends State { final _wifiPassward = TextEditingController(); final _gatewayNamePassward = TextEditingController(); @@ -23,80 +26,159 @@ class _GatewayConfigurationWifiPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( + return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.selectGateway!.tr, haveBack:true, backgroundColor: AppColors.mainColor), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.selectGateway!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), body: ListView.builder( - itemCount:10, - itemBuilder: (c, index){ - return _seletGatewayListListItem('images/mine/icon_mine_gatewayListMainIcon.png', "G2 41c21c", "-34", (){ - Navigator.pushNamed(context, Routers.gatewayConfigurationWifiPage); + itemCount: 10, + itemBuilder: (c, index) { + return _seletGatewayListListItem( + 'images/mine/icon_mine_gatewayListMainIcon.png', + "G2 41c21c", + "-34", () { + Navigator.pushNamed( + context, Routers.gatewayConfigurationWifiPage); }); - } - ), + }), ); } - Widget _seletGatewayListListItem(String lockTypeIcon, String gateWayName, String networkSignal, Function() action){ + Widget _seletGatewayListListItem(String lockTypeIcon, String gateWayName, + String networkSignal, Function() action) { return GestureDetector( onTap: action, child: Container( // height: 100.h, margin: const EdgeInsets.only(bottom: 2), - padding: EdgeInsets.only(left: 10.w, right: 20.w, top: 20.h, bottom: 20.h), - decoration: BoxDecoration( + padding: + EdgeInsets.only(left: 10.w, right: 20.w, top: 16.h, bottom: 16.h), + decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10.w), ), child: Row( children: [ - SizedBox(width: 10.w,), - Image.asset(lockTypeIcon, width: 80.w, height: 80.w,), - SizedBox(width: 20.w,), + SizedBox( + width: 10.w, + ), + Image.asset( + lockTypeIcon, + width: 60.w, + height: 60.w, + ), + SizedBox( + width: 20.w, + ), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -57,32 +72,50 @@ class _SeletGatewayListPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(gateWayName, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + Text( + gateWayName, + style: TextStyle(fontSize: 24.sp), + ), ], ), ), - SizedBox(height:5.h), + SizedBox(height: 5.h), Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 40.w, height: 40.w,), - SizedBox(width: 10.w,), - Text(networkSignal, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + Image.asset( + 'images/mine/icon_mine_gatewaySignal_strong.png', + width: 22.w, + height: 22.w, + ), + SizedBox( + width: 10.w, + ), + Text( + networkSignal, + style: TextStyle(fontSize: 22.sp), + ), ], ), ), - SizedBox(width:20.h), + SizedBox(width: 20.h), ], ), ), - SizedBox(width:20.h), - Image.asset('images/icon_add_white.png', width: 70.w, height: 70.w, color: AppColors.mainColor,), - SizedBox(width: 20.w,), + SizedBox(width: 20.h), + Image.asset( + 'images/icon_add_white.png', + width: 36.w, + height: 36.w, + color: AppColors.mainColor, + ), + SizedBox( + width: 20.w, + ), ], ), ), ); } - } diff --git a/star_lock/lib/mine/gateway/addGateway/seletGatewayType/seletGatewayType_page.dart b/star_lock/lib/mine/gateway/addGateway/seletGatewayType/seletGatewayType_page.dart index a1acb4ca..a2001929 100644 --- a/star_lock/lib/mine/gateway/addGateway/seletGatewayType/seletGatewayType_page.dart +++ b/star_lock/lib/mine/gateway/addGateway/seletGatewayType/seletGatewayType_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -20,36 +19,52 @@ class _SeletGatewayTypePageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.selectGatewayType!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:ListView( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.selectGatewayType!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView( children: [ - _seletGatewayType('images/mine/icon_mine_seletGatewayType_G2.png', "G2(Wi-Fi)", (){ + _seletGatewayType( + 'images/mine/icon_mine_seletGatewayType_G2.png', "G2(Wi-Fi)", + () { Navigator.pushNamed(context, Routers.seletGatewayTypeNextTipPage); }), - SizedBox(height: 2.h,), - _seletGatewayType('images/mine/icon_mine_seletGatewayType_G4.png', "G4(4G) ", (){ + SizedBox( + height: 2.h, + ), + _seletGatewayType( + 'images/mine/icon_mine_seletGatewayType_G4.png', "G4(4G) ", + () { Navigator.pushNamed(context, Routers.seletGatewayTypeNextTipPage); }), ], - ) - ); + )); } - Widget _seletGatewayType(String iconStr, String gatewayType, Function() action){ + Widget _seletGatewayType( + String iconStr, String gatewayType, Function() action) { return GestureDetector( onTap: action, child: Container( color: Colors.white, width: 1.sw, - height: 200.h, + height: 140.h, padding: EdgeInsets.all(30.w), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset(iconStr, width: 150.w, height: 150.w,), - SizedBox(width: 30.w), - Text(gatewayType) + Image.asset( + iconStr, + width: 150.w, + height: 150.w, + ), + // SizedBox(width: 20.w), + Text( + gatewayType, + style: TextStyle(fontSize: 22.sp), + ) ], ), ), diff --git a/star_lock/lib/mine/gateway/addGateway/seletGatewayTypeNextTip/seletGatewayTypeNextTip_page.dart b/star_lock/lib/mine/gateway/addGateway/seletGatewayTypeNextTip/seletGatewayTypeNextTip_page.dart index cd353918..7a414682 100644 --- a/star_lock/lib/mine/gateway/addGateway/seletGatewayTypeNextTip/seletGatewayTypeNextTip_page.dart +++ b/star_lock/lib/mine/gateway/addGateway/seletGatewayTypeNextTip/seletGatewayTypeNextTip_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -13,48 +12,62 @@ class SeletGatewayTypeNextTipPage extends StatefulWidget { const SeletGatewayTypeNextTipPage({Key? key}) : super(key: key); @override - State createState() => _SeletGatewayTypeNextTipPageState(); + State createState() => + _SeletGatewayTypeNextTipPageState(); } -class _SeletGatewayTypeNextTipPageState extends State { +class _SeletGatewayTypeNextTipPageState + extends State { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.addGateway!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:ListView( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.addGateway!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView( children: [ SizedBox(height: 40.h), - Center(child: Text(TranslationLoader.lanKeys!.turnThePowerBackOn!.tr, style: TextStyle(fontSize: 34.sp, fontWeight: FontWeight.w500),)), + Center( + child: Text( + TranslationLoader.lanKeys!.turnThePowerBackOn!.tr, + style: TextStyle(fontSize: 24.sp), + )), SizedBox(height: 80.h), Stack( alignment: Alignment.center, children: [ Positioned( - bottom: 40.h, - left: 190.w, - child: Text(TranslationLoader.lanKeys!.indicatorLight!.tr) - ), - Image.asset("images/mine/icon_mine_seletGatewayType_next.png", width: 300.w, height: 300.w), + bottom: 50.h, + left: 120.w, + child: Text( + TranslationLoader.lanKeys!.indicatorLight!.tr, + style: TextStyle(fontSize: 20.sp), + )), + Image.asset("images/mine/icon_mine_seletGatewayType_next.png", + width: 220.w, height: 220.w), ], ), SizedBox(height: 50.w), Container( padding: EdgeInsets.all(20.w), - child: Center(child: Text(TranslationLoader.lanKeys!.seletGatewayTypeNextTip!.tr, textAlign: TextAlign.center,))) - , + child: Center( + child: Text( + TranslationLoader.lanKeys!.seletGatewayTypeNextTip!.tr, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 18.sp), + ))), SizedBox(height: 40.w), - SubmitBtn( - btnName: TranslationLoader.lanKeys!.next!.tr, - borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w, bottom: 20.w), - padding: EdgeInsets.only(top: 15.w, bottom: 15.w), - onClick: (){ - Navigator.pushNamed(context, Routers.seletGatewayPage); - } + Container( + padding: EdgeInsets.only(left: 20.w, right: 20.w), + child: SubmitBtn( + btnName: TranslationLoader.lanKeys!.next!.tr, + onClick: () { + Navigator.pushNamed(context, Routers.seletGatewayPage); + }), ), ], - ) - ); + )); } } diff --git a/star_lock/lib/mine/gateway/gatewayDetail/gatewayDetail_page.dart b/star_lock/lib/mine/gateway/gatewayDetail/gatewayDetail_page.dart index 07e50368..d10e9edb 100644 --- a/star_lock/lib/mine/gateway/gatewayDetail/gatewayDetail_page.dart +++ b/star_lock/lib/mine/gateway/gatewayDetail/gatewayDetail_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -25,32 +24,63 @@ class _GatewayDetailPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.gateway!.tr, haveBack:true, backgroundColor: AppColors.mainColor), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.gateway!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), body: ListView( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.designation!.tr, rightTitle:"星锁网关", isHaveLine: true, isHaveDirection: true, action: (){ - showCupertinoAlertDialog(context); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.state!.tr, rightTitle:"在线", isHaveLine: true, isHaveDirection: false), - CommonItem(leftTitel:TranslationLoader.lanKeys!.wifiName!.tr, rightTitle:"XinHongJia", isHaveLine: true, isHaveDirection: false), - CommonItem(leftTitel:TranslationLoader.lanKeys!.networkMAC!.tr, rightTitle:"39:23:df:34:12", isHaveLine: false, isHaveDirection: false), - SizedBox(height: 10.h,), - CommonItem(leftTitel:TranslationLoader.lanKeys!.nearbyLock!.tr, rightTitle:"2", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.gatewayConnectionLockPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.gatewayUpgrade!.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ - - }), - SizedBox(height: 80.h,), - SubmitBtn(btnName: TranslationLoader.lanKeys!.delete!.tr, + CommonItem( + leftTitel: TranslationLoader.lanKeys!.designation!.tr, + rightTitle: "星锁网关", + isHaveLine: true, + isHaveDirection: true, + action: () { + showCupertinoAlertDialog(context); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.state!.tr, + rightTitle: "在线", + isHaveLine: true, + isHaveDirection: false), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.wifiName!.tr, + rightTitle: "XinHongJia", + isHaveLine: true, + isHaveDirection: false), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.networkMAC!.tr, + rightTitle: "39:23:df:34:12", + isHaveLine: false, + isHaveDirection: false), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.nearbyLock!.tr, + rightTitle: "2", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed(context, Routers.gatewayConnectionLockPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.gatewayUpgrade!.tr, + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () {}), + SizedBox( + height: 80.h, + ), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.delete!.tr, + isDelete: true, borderRadius: 20.w, fontSize: 32.sp, margin: EdgeInsets.only(left: 30.w, right: 30.w), padding: EdgeInsets.only(top: 15.w, bottom: 15.w), - onClick: () { - - } - ), + onClick: () {}), ], ), ); @@ -61,7 +91,11 @@ class _GatewayDetailPageState extends State { showDialog( context: context, builder: (BuildContext context) { - return ShowTFView(title:"${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.name!.tr}", tipTitle:"请输入", controller: _changeGatewayNameController); + return ShowTFView( + title: + "${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.name!.tr}", + tipTitle: "请输入", + controller: _changeGatewayNameController); }); } } diff --git a/star_lock/lib/mine/gateway/gatewayList/gatewayList_page.dart b/star_lock/lib/mine/gateway/gatewayList/gatewayList_page.dart index e247e947..aefc1036 100644 --- a/star_lock/lib/mine/gateway/gatewayList/gatewayList_page.dart +++ b/star_lock/lib/mine/gateway/gatewayList/gatewayList_page.dart @@ -30,8 +30,8 @@ class _GatewayListPageState extends State { }, child: Image.asset( 'images/icon_add_white.png', - width: 50.w, - height: 50.w, + width: 40.w, + height: 40.w, )), SizedBox( width: 30.w, @@ -60,7 +60,7 @@ class _GatewayListPageState extends State { // height: 100.h, margin: const EdgeInsets.only(bottom: 2), padding: - EdgeInsets.only(left: 10.w, right: 20.w, top: 20.h, bottom: 20.h), + EdgeInsets.only(left: 10.w, right: 20.w, top: 18.h, bottom: 18.h), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10.w), @@ -89,8 +89,7 @@ class _GatewayListPageState extends State { children: [ Text( gateWayName, - style: TextStyle( - fontSize: 28.sp, fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 24.sp), ), ], ), @@ -102,24 +101,23 @@ class _GatewayListPageState extends State { children: [ Image.asset( 'images/mine/icon_mine_gatewayListOnline.png', - width: 40.w, - height: 40.w, + width: 22.w, + height: 22.w, ), SizedBox( width: 10.w, ), Text( "在线", - style: TextStyle( - fontSize: 24.sp, fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 18.sp), ), SizedBox( width: 80.w, ), Image.asset( 'images/mine/icon_mine_gatewayListNumber.png', - width: 40.w, - height: 40.w, + width: 22.w, + height: 22.w, ), SizedBox( width: 10.w, @@ -127,7 +125,7 @@ class _GatewayListPageState extends State { Text( "2", style: TextStyle( - fontSize: 28.sp, fontWeight: FontWeight.w500), + fontSize: 18.sp, fontWeight: FontWeight.w500), ), ], ), diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfo/minePersonInfo_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfo/minePersonInfo_page.dart index 322071f7..b4de92ba 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfo/minePersonInfo_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfo/minePersonInfo_page.dart @@ -22,31 +22,83 @@ class _MinePersonInfoPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.personalInformation!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:Column( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.personalInformation!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Column( children: [ - CommonItem(leftTitel:TranslationLoader.lanKeys!.avatar!.tr, rightTitle:"", allHeight: 100.h, isHaveLine: true,isHaveDirection: true,isHaveRightWidget:true, rightWidget: Container(width: 75.w, height: 75.h,child: Image.asset('images/mine/icon_mine_main_defaultAvatar.png')), action: (){ - _openModalBottomSheet(); - },), - CommonItem(leftTitel:TranslationLoader.lanKeys!.nickName!.tr, rightTitle:"你好", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.minePersonInfoEditNamePage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.accountNumber!.tr, rightTitle:"786612630@qq.com", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.minePersonInfoEditAccountPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.iphone!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.minePersonInfoEditIphonePage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.resetPasswords!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.minePersonInfoResetPasswordPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.safetyProblem!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ - Navigator.pushNamed(context, Routers.minePersonInfoSetSafetyProblemPage); - }), - CommonItem(leftTitel:TranslationLoader.lanKeys!.countryAndRegion!.tr, rightTitle:"中国", isHaveLine: false, isHaveDirection: false), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.avatar!.tr, + rightTitle: "", + allHeight: 100.h, + isHaveLine: true, + isHaveDirection: true, + isHaveRightWidget: true, + rightWidget: Container(), + /* + Container( + width: 75.w, + height: 75.h, + child: Image.asset( + 'images/mine/icon_mine_main_defaultAvatar.png')), + */ + action: () { + _openModalBottomSheet(); + }, + ), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.nickName!.tr, + rightTitle: "你好", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.minePersonInfoEditNamePage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr, + rightTitle: "786612630@qq.com", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.minePersonInfoEditAccountPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.email!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.minePersonInfoEditEmailPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.resetPasswords!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.minePersonInfoResetPasswordPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.minePersonInfoSetSafetyProblemPage); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr, + rightTitle: "中国", + isHaveLine: false, + isHaveDirection: false), ], - ) - ); + )); } Future _openModalBottomSheet() async { @@ -82,8 +134,6 @@ class _MinePersonInfoPageState extends State { ], ), ); - } - ); + }); } - } diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/minePersonInfoEditAccount_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/minePersonInfoEditAccount_page.dart index fab8121d..da48fab7 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/minePersonInfoEditAccount_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/minePersonInfoEditAccount_page.dart @@ -12,69 +12,79 @@ class MinePersonInfoEditAccountPage extends StatefulWidget { const MinePersonInfoEditAccountPage({Key? key}) : super(key: key); @override - State createState() => _MinePersonInfoEditAccountPageState(); + State createState() => + _MinePersonInfoEditAccountPageState(); } -class _MinePersonInfoEditAccountPageState extends State { +class _MinePersonInfoEditAccountPageState + extends State { final TextEditingController _editAccountController = TextEditingController(); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.modifyAccount!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:Column( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.modifyAccount!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Column( children: [ Container( - width: 1.sw, - color: Colors.grey.shade300, - padding: EdgeInsets.only(left:15.w, top: 10.h, bottom: 10.h), - child: Text(TranslationLoader.lanKeys!.modifyAccountTip!.tr) - ), + width: 1.sw, + color: AppColors.greyBackgroundColor, + padding: EdgeInsets.only(left: 15.w, top: 10.h, bottom: 10.h), + child: Text( + TranslationLoader.lanKeys!.modifyAccountTip!.tr, + style: TextStyle(fontSize: 20.sp), + )), Container( - padding: EdgeInsets.all(30.w), + padding: EdgeInsets.all(20.h), + height: 110.h, child: TextField( - maxLines: 1, + // maxLines: 1, keyboardType: TextInputType.text, // inputFormatters: inputFormatterstters??[], - controller:_editAccountController, + controller: _editAccountController, autofocus: false, textAlign: TextAlign.start, - style:TextStyle( - height: 1.1, - fontSize: 30.sp, + style: TextStyle( + height: 3.2, + fontSize: 22.sp, fontWeight: FontWeight.w400, - color: const Color(0xFF333333) - ), + color: const Color(0xFF333333)), decoration: InputDecoration( hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, hintStyle: TextStyle( - height: 1.1, - fontSize: 30.sp, - fontWeight: FontWeight.w400, - color: const Color(0xFF999999) - ), + // height: 3.0, + fontSize: 22.sp, + color: const Color(0xFF999999)), // labelText:"label", labelStyle: const TextStyle(color: Color(0xFF999999)), border: const OutlineInputBorder( ///设置边框四个角的弧度 borderRadius: BorderRadius.all(Radius.circular(10)), + ///用来配置边框的样式 borderSide: BorderSide( ///设置边框的颜色 color: Color(0xffD3D3D3), + ///设置边框的粗细 width: 1, ), ), + ///设置输入框可编辑时的边框样式 enabledBorder: const OutlineInputBorder( ///设置边框四个角的弧度 borderRadius: BorderRadius.all(Radius.circular(10)), + ///用来配置边框的样式 borderSide: BorderSide( ///设置边框的颜色 color: Color(0xffD3D3D3), + ///设置边框的粗细 width: 1, ), @@ -82,37 +92,43 @@ class _MinePersonInfoEditAccountPageState extends State createState() => _MinePersonInfoEditAccountNextPageState(); + State createState() => + _MinePersonInfoEditAccountNextPageState(); } -class _MinePersonInfoEditAccountNextPageState extends State { +class _MinePersonInfoEditAccountNextPageState + extends State { final TextEditingController _editAccountController = TextEditingController(); late Timer _timer; int _seconds = 60; @@ -28,53 +29,77 @@ class _MinePersonInfoEditAccountNextPageState extends State createState() => _MinePersonInfoEditIphonePageState(); + State createState() => + _MinePersonInfoEditIphonePageState(); } -class _MinePersonInfoEditIphonePageState extends State { +class _MinePersonInfoEditIphonePageState + extends State { final TextEditingController _phoneController = TextEditingController(); final TextEditingController _codeController = TextEditingController(); late Timer _timer; @@ -29,18 +30,23 @@ class _MinePersonInfoEditIphonePageState extends State createState() => _MinePersonInfoEditNamePageState(); + State createState() => + _MinePersonInfoEditNamePageState(); } -class _MinePersonInfoEditNamePageState extends State { - final TextEditingController _changeNickNameController = TextEditingController(); +class _MinePersonInfoEditNamePageState + extends State { + final TextEditingController _changeNickNameController = + TextEditingController(); @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.changeNickName!.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ - TextButton( - child: Text(TranslationLoader.lanKeys!.save!.tr, style: const TextStyle(color: Colors.white),), - onPressed: (){ - - },),], + backgroundColor: Colors.white, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.changeNickName!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.save!.tr, + style: TextStyle(color: Colors.white, fontSize: 24.sp), + ), + onPressed: () {}, + ), + ], ), - body:Container( + body: Container( padding: EdgeInsets.all(15.w), child: Column( children: [ - LoginInput(controller: _changeNickNameController, isPwd: true, leftWidget:SizedBox(width: 15.w), hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr} ${TranslationLoader.lanKeys!.password!.tr}",inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - ]), + LoginInput( + controller: _changeNickNameController, + isPwd: true, + leftWidget: SizedBox(width: 15.w), + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.accountNumber!.tr}", + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + ]), ], ), - ) - ); + )); } } diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart new file mode 100644 index 00000000..8615a9a3 --- /dev/null +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart @@ -0,0 +1,117 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../appRouters.dart'; +import '../../../app_settings/app_colors.dart'; +import '../../../tools/submitBtn.dart'; +import '../../../tools/tf_loginInput.dart'; +import '../../../tools/titleAppBar.dart'; +import '../../../translations/trans_lib.dart'; + +class MinePersonInfoEditEmailPage extends StatefulWidget { + const MinePersonInfoEditEmailPage({Key? key}) : super(key: key); + + @override + State createState() => + _MinePersonInfoEditEmailPageState(); +} + +class _MinePersonInfoEditEmailPageState + extends State { + final TextEditingController _phoneController = TextEditingController(); + final TextEditingController _codeController = TextEditingController(); + late Timer _timer; + int _seconds = 60; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.email!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Container( + padding: EdgeInsets.only(top: 10.h, left: 30.w, right: 30.w), + child: Column( + children: [ + Container( + width: 1.sw, + padding: EdgeInsets.only(top: 5.h, bottom: 5.h), + child: Text( + TranslationLoader.lanKeys!.changeEmailTip!.tr, + style: TextStyle(fontSize: 20.sp), + )), + LoginInput( + controller: _phoneController, + isPwd: true, + leftWidget: const SizedBox(), + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.email!.tr}", + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 10.w), + Row( + children: [ + Expanded( + child: LoginInput( + controller: _codeController, + isPwd: true, + leftWidget: const SizedBox(), + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}", + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + ]), + ), + SizedBox( + width: 20.w, + ), + GestureDetector( + child: Container( + width: 140.w, + // height: 60.h, + padding: EdgeInsets.all(8.h), + decoration: BoxDecoration( + color: AppColors.mainColor, + borderRadius: BorderRadius.circular(5)), + child: Center( + child: Text( + _seconds == 60 + ? '${TranslationLoader.lanKeys!.getTip!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}' + : (_seconds < 10) + ? '0$_seconds s' + : '$_seconds s', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 22.sp, + )), + ), + ), + onTap: () { + if (_seconds == 60) { + // _setVerify(); + } else { + // Toast.show(msg: '正在获取验证码'); + } + }, + ) + ], + ), + SizedBox(height: 50.w), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.sure!.tr, + fontSize: 28.sp, + borderRadius: 20.w, + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), + ], + ), + )); + } +} diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart index 6c875413..915c6def 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart @@ -13,10 +13,12 @@ class MinePersonInfoResetPasswordPage extends StatefulWidget { const MinePersonInfoResetPasswordPage({Key? key}) : super(key: key); @override - State createState() => _MinePersonInfoResetPasswordPageState(); + State createState() => + _MinePersonInfoResetPasswordPageState(); } -class _MinePersonInfoResetPasswordPageState extends State { +class _MinePersonInfoResetPasswordPageState + extends State { final TextEditingController _oldPwdController = TextEditingController(); final TextEditingController _newPwdController = TextEditingController(); final TextEditingController _surePwdController = TextEditingController(); @@ -25,49 +27,63 @@ class _MinePersonInfoResetPasswordPageState extends State createState() => _MinePersonInfoSetSafetyProblemPageState(); + State createState() => + _MinePersonInfoSetSafetyProblemPageState(); } -class _MinePersonInfoSetSafetyProblemPageState extends State { +class _MinePersonInfoSetSafetyProblemPageState + extends State { final _fristEditingController = TextEditingController(); final _secondEditingController = TextEditingController(); final _thirdEditingController = TextEditingController(); @@ -25,45 +27,61 @@ class _MinePersonInfoSetSafetyProblemPageState extends State[ - ListTile(title: Text('你第一次乘坐飞机取得是哪个城市?', textAlign: TextAlign.center), + ListTile( + title: Text('你第一次乘坐飞机取得是哪个城市?', textAlign: TextAlign.center), onTap: () { Navigator.of(context).pop(true); }, ), - ListTile(title: Text('你的QQ号码是多少', textAlign: TextAlign.center), + ListTile( + title: Text('你的QQ号码是多少', textAlign: TextAlign.center), onTap: () { Navigator.of(context).pop(true); }, ), - ListTile(title: Text('你的第一个宠物叫什么名字', textAlign: TextAlign.center), + ListTile( + title: Text('你的第一个宠物叫什么名字', textAlign: TextAlign.center), onTap: () { Navigator.of(context).pop(true); }, ), - ], ), ); - } - ); + }); } - } diff --git a/star_lock/lib/mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_page.dart b/star_lock/lib/mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_page.dart index 9633f116..72799c6e 100644 --- a/star_lock/lib/mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_page.dart +++ b/star_lock/lib/mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -13,79 +12,120 @@ class APPUnlockNeedMobileNetworkingLockPage extends StatefulWidget { const APPUnlockNeedMobileNetworkingLockPage({Key? key}) : super(key: key); @override - State createState() => _APPUnlockNeedMobileNetworkingLockPageState(); + State createState() => + _APPUnlockNeedMobileNetworkingLockPageState(); } -class _APPUnlockNeedMobileNetworkingLockPageState extends State { +class _APPUnlockNeedMobileNetworkingLockPageState + extends State { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.appUnlockRequiresMobilePhoneAccessToTheLock!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:Column( + appBar: TitleAppBar( + barTitle: TranslationLoader + .lanKeys!.appUnlockRequiresMobilePhoneAccessToTheLock!.tr, + haveBack: true, + actionsList: [ + IconButton( + onPressed: () {}, + icon: Image.asset( + "images/icon_bar_search.png", + width: 30.w, + height: 30.w, + )) + ], + backgroundColor: AppColors.mainColor), + body: Column( children: [ Container( padding: EdgeInsets.all(30.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text(TranslationLoader.lanKeys!.appUnlockRequiresMobilePhoneAccessToTheLockTip!.tr)), + Expanded( + child: Text( + TranslationLoader.lanKeys! + .appUnlockRequiresMobilePhoneAccessToTheLockTip!.tr, + style: TextStyle(fontSize: 22.sp), + )), ], ), ), - CommonItem(leftTitel:TranslationLoader.lanKeys!.checkAll!.tr, rightTitle:"", allHeight:100.h, isHaveLine: false, isHaveRightWidget: true, + CommonItem( + leftTitel: TranslationLoader.lanKeys!.checkAll!.tr, + rightTitle: "", + allHeight: 70.h, + isHaveLine: false, + isHaveRightWidget: true, rightWidget: GestureDetector( - onTap: (){ - - }, - child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) - ), + onTap: () {}, + child: Row( + children: [ + Image.asset( + 'images/icon_round_unSelet.png', + width: 26.w, + height: 26.w, + ), + ], + ), + )), SizedBox(height: 15.h), Expanded( child: ListView.builder( - itemCount:10, - itemBuilder: (c, index){ - return _gatewatListItem('images/mine/icon_mine_gatewayListMainIcon.png', "星锁网关", "在线", "2", (){ + itemCount: 10, + itemBuilder: (c, index) { + return _gatewatListItem( + 'images/mine/icon_mine_gatewayListMainIcon.png', + "星锁网关", + "在线", + "2", () { // Navigator.pushNamed(context, Routers.gatewayDetailPage); }); - } - ), - ), - SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, - borderRadius: 20.w, - fontSize: 32.sp, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.h, bottom: 30.h), - padding: EdgeInsets.only(top: 20.w, bottom: 20.w), - onClick: () { - - } + }), ), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () {}), + SizedBox( + height: 40.h, + ) ], - ) - ); + )); } - Widget _gatewatListItem(String lockTypeIcon, String gateWayName, String isOnline, String lockNumber, Function() action){ + Widget _gatewatListItem(String lockTypeIcon, String gateWayName, + String isOnline, String lockNumber, Function() action) { return GestureDetector( onTap: action, child: Container( height: 80.h, margin: const EdgeInsets.only(bottom: 2), - padding: EdgeInsets.only(left: 10.w, right: 20.w, top: 20.h, bottom: 20.h), - decoration: BoxDecoration( + padding: + EdgeInsets.only(left: 10.w, right: 20.w, top: 20.h, bottom: 20.h), + decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10.w), ), child: Row( children: [ - SizedBox(width: 15.w,), - Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,), - SizedBox(width: 10.w,), - Text("MCBN01_8f3106", style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w600),) + SizedBox( + width: 15.w, + ), + Image.asset( + 'images/icon_round_unSelet.png', + width: 30.w, + height: 30.w, + ), + SizedBox( + width: 10.w, + ), + Text( + "MCBN01_8f3106", + style: TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w600), + ) ], ), ), ); } - } diff --git a/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart b/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart new file mode 100644 index 00000000..5ccef3b0 --- /dev/null +++ b/star_lock/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart @@ -0,0 +1,366 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get_utils/get_utils.dart'; +import 'package:star_lock/appRouters.dart'; +import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:star_lock/tools/commonItem.dart'; +import 'package:star_lock/tools/submitBtn.dart'; +import 'package:star_lock/translations/trans_lib.dart'; + +class AddAuthorizedAdministratorPage extends StatefulWidget { + const AddAuthorizedAdministratorPage({Key? key}) : super(key: key); + + @override + State createState() { + return _AddAuthorizedAdministratorPageState(); + } +} + +class _AddAuthorizedAdministratorPageState + extends State + with SingleTickerProviderStateMixin { + TabController? _tabController; + final FlutterContactPicker _contactPicker = FlutterContactPicker(); + late Contact _contact; + final _templateNameTf = TextEditingController(); + + List tabs = [ + TranslationLoader.lanKeys!.permanent!.tr, + TranslationLoader.lanKeys!.timeLimit!.tr + ]; + + @override + void initState() { + super.initState(); + + _tabController = TabController(length: 2, vsync: this); + } + + @override + Widget build(BuildContext context) { + return DefaultTabController( + length: 2, + child: Scaffold( + appBar: AppBar( + backgroundColor: AppColors.mainColor, + title: Text( + TranslationLoader.lanKeys!.addAuthorizedAdmin!.tr, + style: TextStyle( + color: Colors.white, + fontSize: 28.sp, + fontWeight: FontWeight.w600), + ), + elevation: 0, + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios, color: Colors.white), + onPressed: () => Navigator.of(context).pop(), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(45), + child: Material( + color: Colors.white, + child: Theme( + data: ThemeData( + ///点击的背景高亮颜色,处理阴影 + highlightColor: Colors.transparent, + + ///点击水波纹颜色 + splashColor: Colors.transparent, + ), + child: TabBar( + controller: _tabController, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: AppColors.mainColor, + unselectedLabelColor: AppColors.blackColor, + labelColor: AppColors.mainColor, + // isScrollable: true, + tabs: tabs.map((e) => Tab(text: e)).toList()), + )), + ), + ), + body: TabBarView(controller: _tabController, children: [ + _permanentAdministrator(), + _timeLimitAdministrator() + ]))); + } + +//永久 + Widget _permanentAdministrator() { + return Column( + children: [ + SizedBox( + height: 10.h, + ), + _buildAccoutRow(), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.lock!.tr, + rightTitle: TranslationLoader.lanKeys!.pleaseSelet!.tr, + isHaveDirection: true, + action: () {}), + SizedBox( + height: 10.h, + ), + remoteUnlockingWidget(), + SizedBox( + height: 20.h, + ), + _buildSureBtn() + ], + ); + } + + //限时管理员 + Widget _timeLimitAdministrator() { + return Column( + children: [ + SizedBox( + height: 10.h, + ), + _buildAccoutRow(), + SizedBox( + height: 10.h, + ), + keyTimeWidget(), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.lock!.tr, + rightTitle: TranslationLoader.lanKeys!.pleaseSelet!.tr, + isHaveDirection: true, + action: () {}), + SizedBox( + height: 10.h, + ), + remoteUnlockingWidget(), + SizedBox( + height: 20.h, + ), + _buildSureBtn() + ], + ); + } + + Widget _buildAccoutRow() { + return Column( + children: [ + Container( + color: Colors.white, + height: 60.h, + child: Row( + children: [ + SizedBox( + width: 40.w, + ), + Text( + TranslationLoader.lanKeys!.accountNumber!.tr, + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 24.sp), + ), + Expanded( + child: TextField( + textAlign: TextAlign.right, + keyboardType: TextInputType.text, + onChanged: (value) {}, + decoration: InputDecoration( + border: InputBorder.none, + hintText: + TranslationLoader.lanKeys!.pleaseEnterAccountNumber!.tr, + hintStyle: TextStyle( + color: AppColors.placeholderTextColor, + fontSize: ScreenUtil().setSp(24), + textBaseline: TextBaseline.alphabetic), + ), + )), + SizedBox( + width: 20.w, + ), + Image.asset( + 'images/icon_addressBook.png', + width: 28.w, + height: 28.h, + ), + SizedBox( + width: 40.w, + ) + ], + ), + ), + const SizedBox( + height: 1, + ), + Container( + color: Colors.white, + child: Row( + children: [ + SizedBox( + width: 40.w, + ), + Text( + TranslationLoader.lanKeys!.name!.tr, + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 24.sp), + ), + Expanded( + child: TextField( + textAlign: TextAlign.right, + keyboardType: TextInputType.text, + onChanged: (value) {}, + decoration: InputDecoration( + border: InputBorder.none, + hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle( + color: AppColors.placeholderTextColor, + fontSize: ScreenUtil().setSp(24), + textBaseline: TextBaseline.alphabetic), + ), + )), + SizedBox( + width: 40.w, + ) + ], + ), + ), + ], + ); + } + + Widget getTFWidget(TextEditingController tfController, String tfStr) { + return Container( + height: 50.h, + width: 500.w, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + controller: tfController, + autofocus: false, + textAlign: TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + ], + ), + ); + } + + // 远程开锁 + Widget remoteUnlockingWidget() { + return Column( + children: [ + CommonItem( + leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr, + rightTitle: "", + isHaveRightWidget: true, + rightWidget: Container(width: 80.w, height: 50.h, child: _switch()), + action: () {}), + Container(height: 40.h), + ], + ); + } + + // 生效失效时间 + Widget keyTimeWidget() { + return Column( + children: [ + CommonItem( + leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveLine: true, + isHaveDirection: true, + action: () { + // _showDatePicker(); + }), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, + rightTitle: "2020.06.20 11:49", + isHaveDirection: true, + action: () { + // _showDatePicker(); + }), + Container(height: 10.h), + ], + ); + } + + Widget keyBottomWidget(String tipStr) { + return Column( + children: [ + Container( + padding: EdgeInsets.all(20.w), + child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + tipStr, + textAlign: TextAlign.start, + )), + ], + ), + ), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.sender!.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), + Container( + padding: EdgeInsets.only(right: 30.w), + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () { + Navigator.pushNamed( + context, Routers.volumeAuthorizationLockManagePage); + }, + child: Text( + TranslationLoader.lanKeys!.volumeAuthorizationLock!.tr, + style: TextStyle( + color: AppColors.mainColor, + fontWeight: FontWeight.w500), + )), + ], + ), + ), + ], + ); + } + + CupertinoSwitch _switch() { + bool _isOn = false; + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: _isOn, + onChanged: (value) { + setState(() { + _isOn = value; + }); + }, + ); + } + + Widget _buildSureBtn() { + return SubmitBtn( + btnName: TranslationLoader.lanKeys!.sure!.tr, + onClick: () {}, + ); + } +} diff --git a/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart b/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart index 42225461..df90fec3 100644 --- a/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart +++ b/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart @@ -30,7 +30,8 @@ class _AuthorizedAdministratorListPageState icon: Image.asset('images/icon_add_white.png'), onPressed: () { // 处理操作按钮的点击事件 - Navigator.pushNamed(context, Routers.authorizedAdminManagePage); + Navigator.pushNamed( + context, Routers.addAuthorizedAdministratorPage); }, ), ], @@ -47,7 +48,7 @@ class _AuthorizedAdministratorListPageState Widget _searchWidget() { return Container( height: 60.h, - margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w), + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5)), child: TextField( @@ -55,17 +56,19 @@ class _AuthorizedAdministratorListPageState maxLines: 1, // controller: _controller, autofocus: false, + decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only( top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, @@ -81,7 +84,7 @@ class _AuthorizedAdministratorListPageState return ListView.builder( itemCount: 10, itemBuilder: (c, index) { - return _electronicKeyItem('images/icon_lock.png', "张三", + return _electronicKeyItem('images/controls_user.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15", () { Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); }); @@ -93,7 +96,7 @@ class _AuthorizedAdministratorListPageState return GestureDetector( onTap: action, child: Container( - height: 100.h, + height: 90.h, margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), decoration: BoxDecoration( color: Colors.white, @@ -106,8 +109,8 @@ class _AuthorizedAdministratorListPageState ), Image.asset( lockTypeIcon, - width: 50.w, - height: 50.w, + width: 44.w, + height: 44.w, ), SizedBox( width: 30.w, @@ -122,7 +125,7 @@ class _AuthorizedAdministratorListPageState Text( lockTypeTitle, style: TextStyle( - fontSize: 32.sp, fontWeight: FontWeight.w500), + fontSize: 24.sp, fontWeight: FontWeight.w500), ), ], ), @@ -134,7 +137,8 @@ class _AuthorizedAdministratorListPageState Text( "2023.6.21 11.15 永久", style: TextStyle( - fontSize: 28.sp, fontWeight: FontWeight.w500), + fontSize: 20.sp, + color: AppColors.darkGrayTextColor), ), ], ), diff --git a/star_lock/lib/mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart b/star_lock/lib/mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart index 5863154c..048f332d 100644 --- a/star_lock/lib/mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart +++ b/star_lock/lib/mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -12,45 +11,63 @@ class HideInvalidUnlockPermissionsPage extends StatefulWidget { const HideInvalidUnlockPermissionsPage({Key? key}) : super(key: key); @override - State createState() => _HideInvalidUnlockPermissionsPageState(); + State createState() => + _HideInvalidUnlockPermissionsPageState(); } -class _HideInvalidUnlockPermissionsPageState extends State { +class _HideInvalidUnlockPermissionsPageState + extends State { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.hideInvalidUnlockPermissions!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:Container( + appBar: TitleAppBar( + barTitle: + TranslationLoader.lanKeys!.hideInvalidUnlockPermissions!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Container( padding: EdgeInsets.all(30.w), child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text(TranslationLoader.lanKeys!.hideInvalidUnlockPermissionsTip!.tr)), + Expanded( + child: Text( + TranslationLoader + .lanKeys!.hideInvalidUnlockPermissionsTip!.tr, + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 22.sp), + )), ], ), - SizedBox(height: 20.h,), + SizedBox( + height: 20.h, + ), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text("${TranslationLoader.lanKeys!.currentMode!.tr} : ${TranslationLoader.lanKeys!.opened!.tr}", style: TextStyle(fontWeight: FontWeight.w600),)), + Expanded( + child: Text( + "${TranslationLoader.lanKeys!.currentMode!.tr} : ${TranslationLoader.lanKeys!.opened!.tr}", + style: + TextStyle(fontWeight: FontWeight.w600, fontSize: 22.sp), + )), ], ), - SizedBox(height: 30.h,), - SubmitBtn(btnName: TranslationLoader.lanKeys!.closed!.tr, + SizedBox( + height: 40.h, + ), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.closed!.tr, borderRadius: 20.w, 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: () {}), ], ), - ) - ); + )); } } diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart index 6d22bf78..e6289123 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart @@ -22,7 +22,7 @@ class _LockGroupListPageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.basicInformation!.tr, + barTitle: TranslationLoader.lanKeys!.lockGroup!.tr, haveBack: true, actionsList: [ IconButton( @@ -47,13 +47,20 @@ class _LockGroupListPageState extends State { itemBuilder: (c, index) { if (index == 1) { return Center( - child: SizedBox( - height: 40.h, - child: const Text( - '锁数量:1', - style: TextStyle( - color: AppColors.darkGrayTextColor, fontSize: 14), - ), + child: Column( + children: [ + SizedBox( + height: 10.h, + ), + SizedBox( + height: 40.h, + child: const Text( + '锁数量:1', + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 14), + ), + ) + ], ), ); } else { diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart index 9b87feec..92ebb0c0 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart @@ -20,14 +20,32 @@ class _LockItemListPageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.basicInformation!.tr, + barTitle: TranslationLoader.lanKeys!.lock!.tr, haveBack: true, + actionsList: [ + IconButton( + icon: Image.asset( + 'images/icon_bar_more.png', + height: 30.h, + width: 10.w, + ), + onPressed: () { + // 处理操作按钮的点击事件-添加锁分组 + }, + ), + ], backgroundColor: AppColors.mainColor), - body: ListView.builder( + body: ListView.separated( itemBuilder: (context, index) { return _listItemView(); }, itemCount: 2, + separatorBuilder: (BuildContext context, int index) { + return Divider( + height: 1.h, + color: AppColors.greyLineColor, + ); + }, ), ); } @@ -51,7 +69,7 @@ class _LockItemListPageState extends State { fit: BoxFit.fill, ), SizedBox( - width: 8.w, + width: 10.w, ), const Text( 'Daisy', diff --git a/star_lock/lib/mine/mineSet/lockScreen/lockScreen_page.dart b/star_lock/lib/mine/mineSet/lockScreen/lockScreen_page.dart index 4fbdec69..1105eb9b 100644 --- a/star_lock/lib/mine/mineSet/lockScreen/lockScreen_page.dart +++ b/star_lock/lib/mine/mineSet/lockScreen/lockScreen_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -20,37 +19,47 @@ class _LockScreenPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.lockScreen!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:Container( + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.lockScreen!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Container( padding: EdgeInsets.all(30.w), child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text(TranslationLoader.lanKeys!.lockSoundTip!.tr)), + Expanded( + child: Text( + TranslationLoader.lanKeys!.lockSoundTip!.tr, + style: TextStyle( + fontSize: 22.sp, color: AppColors.darkGrayTextColor), + )), ], ), - SizedBox(height: 20.h,), + SizedBox( + height: 20.h, + ), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text("${TranslationLoader.lanKeys!.currentMode!.tr} : ${TranslationLoader.lanKeys!.opened!.tr}", style: TextStyle(fontWeight: FontWeight.w600),)), + Expanded( + child: Text( + "${TranslationLoader.lanKeys!.currentMode!.tr} : ${TranslationLoader.lanKeys!.opened!.tr}", + style: + TextStyle(fontWeight: FontWeight.w600, fontSize: 22.sp), + )), ], ), - SizedBox(height: 30.h,), - SubmitBtn(btnName: TranslationLoader.lanKeys!.closed!.tr, - borderRadius: 20.w, - 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: () { - - } + SizedBox( + height: 40.h, ), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.closed!.tr, + onClick: () {}), ], ), - ) - ); + )); } } diff --git a/star_lock/lib/mine/mineSet/lockUserManage/lockUserManageList_page.dart b/star_lock/lib/mine/mineSet/lockUserManage/lockUserManageList_page.dart index 2b5bef11..9e9d83a5 100644 --- a/star_lock/lib/mine/mineSet/lockUserManage/lockUserManageList_page.dart +++ b/star_lock/lib/mine/mineSet/lockUserManage/lockUserManageList_page.dart @@ -29,7 +29,7 @@ class _LockUserManageListListPageState TextButton( child: Text( TranslationLoader.lanKeys!.aboutToExpire!.tr, - style: const TextStyle(color: Colors.white), + style: TextStyle(color: Colors.white, fontSize: 24.sp), ), onPressed: () {}, ), @@ -38,6 +38,9 @@ class _LockUserManageListListPageState body: Column( children: [ _searchWidget(), + SizedBox( + height: 20.h, + ), Expanded(child: _buildMainUI()), SizedBox( width: ScreenUtil().screenWidth - 40.w, @@ -46,12 +49,15 @@ class _LockUserManageListListPageState style: ElevatedButton.styleFrom( backgroundColor: Colors.white, ), - onPressed: () {}, + onPressed: () { + Navigator.pushNamed( + context, Routers.massSendElectronicKeyManagePage); + }, child: Text( '群发钥匙', style: TextStyle( color: AppColors.mainColor, - fontSize: 28.sp, + fontSize: 24.sp, fontWeight: FontWeight.w600), )), ), @@ -79,12 +85,13 @@ class _LockUserManageListListPageState contentPadding: const EdgeInsets.only( top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, @@ -100,7 +107,7 @@ class _LockUserManageListListPageState return ListView.builder( itemCount: 10, itemBuilder: (c, index) { - return _electronicKeyItem('images/icon_lock.png', "张三", + return _electronicKeyItem('images/controls_user.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15", () { Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); }); @@ -112,12 +119,13 @@ class _LockUserManageListListPageState return GestureDetector( onTap: action, child: Container( - height: 100.h, - margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(10.w), - ), + height: 90.h, + margin: EdgeInsets.only(top: 1.h), + color: Colors.white, + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular(10.w), + // ), child: Row( children: [ SizedBox( @@ -125,8 +133,8 @@ class _LockUserManageListListPageState ), Image.asset( lockTypeIcon, - width: 50.w, - height: 50.w, + width: 44.w, + height: 44.w, ), SizedBox( width: 30.w, @@ -140,29 +148,32 @@ class _LockUserManageListListPageState children: [ Text( lockTypeTitle, - style: TextStyle( - fontSize: 32.sp, fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 24.sp), ), ], ), SizedBox(height: 5.h), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - "2023.6.21 11.15 永久", - style: TextStyle( - fontSize: 28.sp, fontWeight: FontWeight.w500), - ), - ], - ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "2023.6.21 11.15 永久", + style: TextStyle( + fontSize: 20.sp, + color: AppColors.darkGrayTextColor), + ), + ], ), SizedBox(width: 20.h), ], ), ), - SizedBox(width: 20.h), + Image.asset( + 'images/icon_right_grey.png', + width: 12.w, + height: 21.w, + ), + SizedBox(width: 20.w), ], ), ), diff --git a/star_lock/lib/mine/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet_page.dart index c5fd0330..6073a4cd 100644 --- a/star_lock/lib/mine/mineSet/mineSet_page.dart +++ b/star_lock/lib/mine/mineSet/mineSet_page.dart @@ -39,21 +39,21 @@ class _MineSetPageState extends State { isHaveLine: true, isHaveRightWidget: true, rightWidget: SizedBox( - width: 80.w, height: 50.h, child: _switch())), + width: 10.w, height: 50.h, child: _switch())), CommonItem( leftTitel: TranslationLoader.lanKeys!.touchUnlock!.tr, rightTitle: "", isHaveLine: true, isHaveRightWidget: true, rightWidget: SizedBox( - width: 80.w, height: 50.h, child: _switch())), + width: 10.w, height: 50.h, child: _switch())), CommonItem( leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr, rightTitle: "", isHaveRightWidget: true, rightWidget: SizedBox( - width: 80.w, height: 50.h, child: _switch())), + width: 10.w, height: 50.h, child: _switch())), SizedBox( height: 10.h, ), @@ -146,7 +146,7 @@ class _MineSetPageState extends State { // // }), SizedBox( - height: 10.h, + height: 50.h, ), // CommonItem(leftTitel:TranslationLoader.lanKeys!.about!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ // @@ -167,45 +167,44 @@ class _MineSetPageState extends State { // CommonItem(leftTitel:TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ // // }), + keyBottomWidget() ], ), ), - // keyBottomWidget() ], )); } - // Widget keyBottomWidget() { - // return Column( - // children: [ - // SubmitBtn(btnName: TranslationLoader.lanKeys!.logout!.tr, - // borderRadius: 20.w, - // fontSize: 32.sp, - // margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), - // padding: EdgeInsets.only(top: 20.w, bottom: 20.w), - // onClick: () { - // - // } - // ), - // Container( - // padding: EdgeInsets.only(right: 30.w), - // // color: Colors.red, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // TextButton( - // child: Text( TranslationLoader.lanKeys!.deleteAccount!.tr, style: TextStyle(color: AppColors.mainColor, fontWeight: FontWeight.w500),), - // onPressed: () { - // - // }, - // ), - // ], - // ), - // ), - // SizedBox(height: 30.h,) - // ], - // ); - // } + Widget keyBottomWidget() { + return Column( + children: [ + SubmitBtn( + btnName: TranslationLoader.lanKeys!.logout!.tr, + isDelete: true, + onClick: () {}), + Container( + padding: EdgeInsets.only(right: 30.w), + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.deleteAccount!.tr, + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 18.sp), + ), + onPressed: () {}, + ), + ], + ), + ), + SizedBox( + height: 30.h, + ) + ], + ); + } CupertinoSwitch _switch() { return CupertinoSwitch( diff --git a/star_lock/lib/mine/mineSet/transferGateway/selectGetewayList_page.dart b/star_lock/lib/mine/mineSet/transferGateway/selectGetewayList_page.dart index 5804a64b..c819482d 100644 --- a/star_lock/lib/mine/mineSet/transferGateway/selectGetewayList_page.dart +++ b/star_lock/lib/mine/mineSet/transferGateway/selectGetewayList_page.dart @@ -28,15 +28,12 @@ class _SelectGetewayListPageState extends State { onPressed: () {}, child: Text( '全选', - style: TextStyle(color: Colors.white, fontSize: 28.sp), + style: TextStyle(color: Colors.white, fontSize: 24.sp), )) ], ), body: Column( children: [ - SizedBox( - height: 10.h, - ), Expanded(child: _buildMainUI()), SizedBox( height: 20.h, @@ -74,7 +71,7 @@ class _SelectGetewayListPageState extends State { return GestureDetector( child: Container( color: Colors.white, - height: 70.h, + height: 80.h, child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, @@ -94,8 +91,8 @@ class _SelectGetewayListPageState extends State { ), Image.asset( 'images/getewayType_G2.png', - width: 60.w, - height: 60.w, + width: 50.w, + height: 50.w, fit: BoxFit.fill, ), SizedBox( @@ -103,7 +100,7 @@ class _SelectGetewayListPageState extends State { ), Text( '星锁网关', - style: TextStyle(fontSize: 28.sp), + style: TextStyle(fontSize: 24.sp), ) ], ), @@ -115,7 +112,7 @@ class _SelectGetewayListPageState extends State { Widget _buildNextBtn() { return GestureDetector( child: Container( - color: Colors.grey, + color: AppColors.btnDisableColor, width: ScreenUtil().screenWidth, height: 64.h, child: TextButton( @@ -124,7 +121,7 @@ class _SelectGetewayListPageState extends State { }, child: Text( '下一步', - style: TextStyle(fontSize: 28.sp, color: Colors.white), + style: TextStyle(fontSize: 24.sp, color: Colors.white), )), ), ); diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation_page.dart index dc8129ea..770654aa 100644 --- a/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation_page.dart +++ b/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/tools/submitBtn.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; @@ -85,8 +86,8 @@ class _RecipientInformationPageState extends State { GestureDetector( child: Image.asset( leftIcon, - width: 16, - height: 16, + width: 20.w, + height: 20.w, ), ), SizedBox( @@ -94,7 +95,7 @@ class _RecipientInformationPageState extends State { ), Text( leftTitle, - style: TextStyle(fontSize: 28.sp), + style: TextStyle(fontSize: 24.sp), ) ], ), @@ -115,7 +116,7 @@ class _RecipientInformationPageState extends State { Text( '账号', style: - TextStyle(color: AppColors.darkGrayTextColor, fontSize: 24.sp), + TextStyle(color: AppColors.darkGrayTextColor, fontSize: 22.sp), ), Expanded( child: TextField( @@ -127,7 +128,7 @@ class _RecipientInformationPageState extends State { hintText: '请输入手机号或email', hintStyle: TextStyle( color: AppColors.placeholderTextColor, - fontSize: ScreenUtil().setSp(24), + fontSize: ScreenUtil().setSp(22), textBaseline: TextBaseline.alphabetic), ), )), @@ -153,28 +154,14 @@ class _RecipientInformationPageState extends State { child: Text( '选中的智能锁将会转移到您输入的账号中,您将失去锁的管理权', style: - TextStyle(fontSize: 20.sp, color: AppColors.placeholderTextColor), + TextStyle(fontSize: 18.sp, color: AppColors.placeholderTextColor), textAlign: TextAlign.left, ), ); } Widget _buildNextBtn() { - return GestureDetector( - child: Container( - color: Colors.grey, - width: ScreenUtil().screenWidth - 80.w, - height: 64.h, - child: TextButton( - onPressed: () { - Navigator.pushNamed(context, Routers.selectBranchPage); - }, - child: Text( - '下一步', - style: TextStyle(fontSize: 28.sp, color: Colors.white), - )), - ), - ); + return SubmitBtn(btnName: '下一步', onClick: () {}); } Widget _buildRemoveBadLockBtn() { @@ -186,7 +173,7 @@ class _RecipientInformationPageState extends State { child: Text( '移除坏锁', style: TextStyle( - fontSize: 28.sp, color: AppColors.darkGrayTextColor), + fontSize: 18.sp, color: AppColors.darkGrayTextColor), textAlign: TextAlign.end, )), SizedBox( diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch_page.dart index e6d63755..910281c7 100644 --- a/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch_page.dart +++ b/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch_page.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/titleAppBar.dart'; import '../../../../translations/trans_lib.dart'; diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLock_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLock_page.dart index 0101074a..dfa010fb 100644 --- a/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLock_page.dart +++ b/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLock_page.dart @@ -28,7 +28,7 @@ class _TransferSmartLockPageState extends State { onPressed: () {}, child: Text( '全选', - style: TextStyle(color: Colors.white, fontSize: 28.sp), + style: TextStyle(color: Colors.white, fontSize: 24.sp), )) ], ), @@ -54,7 +54,7 @@ class _TransferSmartLockPageState extends State { Widget _searchWidget() { return Container( height: 60.h, - margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w), + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5)), child: TextField( @@ -62,17 +62,19 @@ class _TransferSmartLockPageState extends State { maxLines: 1, // controller: _controller, autofocus: false, + decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only( top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 3.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( - top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + top: 20.h, bottom: 20.h, right: 20.w, left: 10.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, @@ -108,7 +110,7 @@ class _TransferSmartLockPageState extends State { return GestureDetector( child: Container( color: Colors.white, - height: 70.h, + height: 90.h, child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, @@ -133,11 +135,11 @@ class _TransferSmartLockPageState extends State { fit: BoxFit.fill, ), SizedBox( - width: 8.w, + width: 10.w, ), - const Text( + Text( 'Daisy', - style: TextStyle(fontSize: 14), + style: TextStyle(fontSize: 22.sp), ) ], ), diff --git a/star_lock/lib/mine/mine_page.dart b/star_lock/lib/mine/mine_page.dart index f33318ff..c78f31f1 100644 --- a/star_lock/lib/mine/mine_page.dart +++ b/star_lock/lib/mine/mine_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -18,7 +17,8 @@ class StarLockMinePage extends StatefulWidget { } GlobalKey<_StarLockMinePageState> starLockMineKey = GlobalKey(); -class _StarLockMinePageState extends State with BaseWidget{ + +class _StarLockMinePageState extends State with BaseWidget { @override Widget build(BuildContext context) { return Scaffold( @@ -28,73 +28,112 @@ class _StarLockMinePageState extends State with BaseWidget{ children: [ topWidget(), bottomListWidget(), - SizedBox(height: 40.h,), - keyBottomWidget() + SizedBox( + height: 40.h, + ), + // keyBottomWidget() ], ), ); } - Widget topWidget(){ + Widget topWidget() { return Container( - height: 450.h, + height: 380.h, width: 1.sw, color: AppColors.mainColor, // color: Colors.red, - child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, + child: Stack( children: [ - SizedBox(height: 120.h,), - GestureDetector( - onTap: (){ - Navigator.pushNamed(context, Routers.starLockLoginPage); - }, - child: Container( - width: 150.w, height: 150.w, - decoration: BoxDecoration( - border: Border.all(width: 2, color: Colors.white), - borderRadius: BorderRadius.circular(75.h), + Image.asset( + 'images/mine/icon_mine_topBg.png', + width: 400.w, + height: 380.h, + fit: BoxFit.fill, + ), + Center( + child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 120.h, ), - padding: EdgeInsets.all(20.w), - child: Image.asset('images/mine/icon_mine_main_defaultAvatar.png', width: 100.w, height: 100.w) + GestureDetector( + onTap: () { + // Navigator.pushNamed(context, Routers.starLockLoginPage); + Navigator.pushNamed(context, Routers.minePersonInfoPage); + }, + child: SizedBox( + width: 108.w, + height: 105.w, + child: Image.asset( + 'images/mine/icon_mine_main_defaultAvatar.png', + width: 60.w, + height: 60.w)), + ), + SizedBox( + height: 20.h, + ), + Text("15080825640", + style: TextStyle( + fontSize: 22.sp, + color: Colors.white, + )), + SizedBox( + height: 10.h, + ), + Text( + "${TranslationLoader.lanKeys!.accountNumber!.tr}:15080825640", + style: TextStyle( + fontSize: 18.sp, + color: Colors.white, + fontWeight: FontWeight.w500)), + ], ), ), - SizedBox(height: 20.h,), - Text("15080825640", style: TextStyle(fontSize: 30.sp, color: Colors.white, fontWeight: FontWeight.w500)), - SizedBox(height: 10.h,), - Text("${TranslationLoader.lanKeys!.accountNumber!.tr}:15080825640", style: TextStyle(fontSize: 22.sp, color: Colors.white, fontWeight: FontWeight.w500)), ], ), ); } - Widget bottomListWidget(){ + Widget bottomListWidget() { return Expanded( child: ListView( - padding: EdgeInsets.only(left: 70.w, top: 50.h, right: 10.w), + padding: EdgeInsets.only( + left: 60.w, + top: 50.h, + ), children: [ - mineItem('images/mine/icon_mine_main_personInfo.png', TranslationLoader.lanKeys!.personalInformation!.tr, (){ - Navigator.pushNamed(context, Routers.minePersonInfoPage); - }), - mineItem('images/mine/icon_mine_main_addLock.png', TranslationLoader.lanKeys!.addLock!.tr, (){ + // mineItem('images/mine/icon_mine_main_personInfo.png', + // TranslationLoader.lanKeys!.personalInformation!.tr, () { + // Navigator.pushNamed(context, Routers.minePersonInfoPage); + // }), + mineItem('images/mine/icon_mine_main_addLock.png', + TranslationLoader.lanKeys!.addDevice!.tr, () { Navigator.pushNamed(context, Routers.seletLockTypePage); }), - mineItem('images/mine/icon_mine_main_gateway.png', TranslationLoader.lanKeys!.gateway!.tr, (){ - Navigator.pushNamed(context, Routers.gatewayListPage); - }), - mineItem('images/mine/icon_mine_main_message.png', TranslationLoader.lanKeys!.message!.tr, (){ + // mineItem('images/mine/icon_mine_main_gateway.png', + // TranslationLoader.lanKeys!.gateway!.tr, () { + // Navigator.pushNamed(context, Routers.gatewayListPage); + // }), + mineItem('images/mine/icon_mine_main_message.png', + TranslationLoader.lanKeys!.message!.tr, () { Navigator.pushNamed(context, Routers.messageListPage); }), - mineItem('images/mine/icon_mine_main_supportStaff.png', TranslationLoader.lanKeys!.supportStaff!.tr, (){ + mineItem('images/mine/icon_mine_main_supportStaff.png', + TranslationLoader.lanKeys!.supportStaff!.tr, () { Navigator.pushNamed(context, Routers.supportStaffPage); }), - mineItem('images/mine/icon_mine_main_set.png', TranslationLoader.lanKeys!.set!.tr, (){ + mineItem('images/mine/icon_mine_main_set.png', + TranslationLoader.lanKeys!.set!.tr, () { Navigator.pushNamed(context, Routers.mineSetPage); }), - mineItem('images/mine/icon_mine_main_vip.png', TranslationLoader.lanKeys!.valueAddedServices!.tr, (){ + mineItem('images/mine/icon_mine_main_vip.png', + TranslationLoader.lanKeys!.valueAddedServices!.tr, () { Navigator.pushNamed(context, Routers.valueAddedServicesPage); }), - mineItem('images/mine/icon_mine_main_about.png', TranslationLoader.lanKeys!.about!.tr, (){ + mineItem('images/mine/icon_mine_main_about.png', + TranslationLoader.lanKeys!.about!.tr, () { Navigator.pushNamed(context, Routers.abountPage); }), ], @@ -105,15 +144,13 @@ class _StarLockMinePageState extends State with BaseWidget{ Widget keyBottomWidget() { return Column( children: [ - SubmitBtn(btnName: TranslationLoader.lanKeys!.logout!.tr, + SubmitBtn( + btnName: TranslationLoader.lanKeys!.logout!.tr, borderRadius: 20.w, fontSize: 32.sp, margin: EdgeInsets.only(left: 60.w, right: 60.w), padding: EdgeInsets.only(top: 15.w, bottom: 15.w), - onClick: () { - - } - ), + onClick: () {}), Container( padding: EdgeInsets.only(right: 30.w), // color: Colors.red, @@ -121,20 +158,25 @@ class _StarLockMinePageState extends State with BaseWidget{ mainAxisAlignment: MainAxisAlignment.end, children: [ TextButton( - child: Text(TranslationLoader.lanKeys!.deleteAccount!.tr, style: TextStyle(color: AppColors.mainColor, fontWeight: FontWeight.w500),), - onPressed: () { - - }, + child: Text( + TranslationLoader.lanKeys!.deleteAccount!.tr, + style: TextStyle( + color: AppColors.mainColor, fontWeight: FontWeight.w500), + ), + onPressed: () {}, ), ], ), ), - SizedBox(height: 30.h,) + SizedBox( + height: 30.h, + ) ], ); } - Widget mineItem(String lockTypeIcon, String lockTypeTitle, Function() action){ + Widget mineItem( + String lockTypeIcon, String lockTypeTitle, Function() action) { return GestureDetector( onTap: action, child: Row( @@ -142,31 +184,35 @@ class _StarLockMinePageState extends State with BaseWidget{ Center( child: Container( // height: 80.h, - width: 400.w, + width: 330.w, padding: EdgeInsets.all(20.h), color: Colors.white, child: Row( children: [ - SizedBox(width:20.w), - Image.asset(lockTypeIcon, width: 40.w, height: 40.w,), - SizedBox(width:15.w), - Expanded(child: Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), )), + Image.asset( + lockTypeIcon, + width: 28.w, + height: 28.w, + ), + SizedBox(width: 15.w), + Text( + lockTypeTitle, + style: TextStyle(fontSize: 22.sp), + ), ], ), ), ), - Container(height: 0.5.h, color: Colors.grey,) + Container( + height: 0.5.h, + color: Colors.grey, + ) ], ), ); } - void onShow(){ + void onShow() {} - } - - void onHide(){ - - } + void onHide() {} } - diff --git a/star_lock/lib/tools/commonItem.dart b/star_lock/lib/tools/commonItem.dart index eb0e1cd3..b7b999da 100644 --- a/star_lock/lib/tools/commonItem.dart +++ b/star_lock/lib/tools/commonItem.dart @@ -40,9 +40,7 @@ class CommonItem extends StatelessWidget { children: [ SizedBox(width: 20.w), Expanded( - child: Text(leftTitel!, - style: TextStyle( - fontSize: 28.sp, fontWeight: FontWeight.w500))), + child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))), SizedBox(width: 20.w), Row( mainAxisAlignment: MainAxisAlignment.end, @@ -53,19 +51,20 @@ class CommonItem extends StatelessWidget { rightTitle!, textAlign: TextAlign.end, style: TextStyle( - fontSize: 28.sp, fontWeight: FontWeight.w500), + fontSize: 22.sp, + color: AppColors.darkGrayTextColor), ) ], ), - SizedBox(width: 5.w), + SizedBox(width: 8.w), isHaveDirection! ? Image.asset( - 'images/icon_right.png', - width: 50.w, - height: 50.w, + 'images/icon_right_grey.png', + width: 12.w, + height: 21.w, ) - : SizedBox(width: 10.w), - // SizedBox(width:10.w), + : SizedBox(width: 20.w), + SizedBox(width: 20.w), ], ), ), diff --git a/star_lock/lib/tools/submitBtn.dart b/star_lock/lib/tools/submitBtn.dart index a0f8c2c7..f13751d4 100644 --- a/star_lock/lib/tools/submitBtn.dart +++ b/star_lock/lib/tools/submitBtn.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import '../app_settings/app_colors.dart'; @@ -27,6 +28,8 @@ class SubmitBtn extends StatelessWidget { double? borderRadius; + bool? isDelete; + SubmitBtn( {Key? key, required this.btnName, @@ -37,6 +40,7 @@ class SubmitBtn extends StatelessWidget { this.margin, this.width, this.backgroundColorList, + this.isDelete, this.fontSize}) : super(key: key); @@ -44,10 +48,11 @@ class SubmitBtn extends StatelessWidget { Widget build(BuildContext context) { return SizedBox( width: ScreenUtil().screenWidth - 40.w, - height: 44, + height: 60.h, child: ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: AppColors.mainColor, + backgroundColor: + isDelete == true ? Colors.red : AppColors.mainColor, ), onPressed: () { if (onClick != null) { @@ -56,7 +61,7 @@ class SubmitBtn extends StatelessWidget { }, child: Text( btnName!, - style: TextStyle(color: Colors.white, fontSize: 30.sp), + style: TextStyle(color: Colors.white, fontSize: 24.sp), )), ); /* diff --git a/star_lock/lib/tools/tf_loginInput.dart b/star_lock/lib/tools/tf_loginInput.dart index 2862b123..53637088 100644 --- a/star_lock/lib/tools/tf_loginInput.dart +++ b/star_lock/lib/tools/tf_loginInput.dart @@ -8,7 +8,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; * */ class LoginInput extends StatelessWidget { - TextEditingController? controller; List? inputFormatters; TextInputType? keyboardType; @@ -19,7 +18,19 @@ class LoginInput extends StatelessWidget { String? label; bool? isPwd; Widget? rightSlot; - LoginInput({Key? key, required this.controller,this.rightSlot,this.label,this.isPwd,this.inputFormatters,this.keyboardType,this.background,this.hintText, this.isHaveLeftWidget = true, this.leftWidget}) : super(key: key); + LoginInput( + {Key? key, + required this.controller, + this.rightSlot, + this.label, + this.isPwd, + this.inputFormatters, + this.keyboardType, + this.background, + this.hintText, + this.isHaveLeftWidget = true, + this.leftWidget}) + : super(key: key); @override Widget build(BuildContext context) { @@ -36,17 +47,28 @@ class LoginInput extends StatelessWidget { autofocus: false, decoration: InputDecoration( //输入里面输入文字内边距设置 - contentPadding: const EdgeInsets.only(top: 8.0, left: -19.0, right: -15.0, bottom: 8.0), + contentPadding: const EdgeInsets.only( + top: 8.0, left: -19.0, right: -15.0, bottom: 8.0), labelText: label, + labelStyle: TextStyle(fontSize: 22.sp), + hintStyle: TextStyle(fontSize: 22.sp), hintText: hintText, //不需要输入框下划线 border: InputBorder.none, //左边图标设置 - icon: isHaveLeftWidget == true?leftWidget:SizedBox(width: 20.w, height: 40.w,), + icon: isHaveLeftWidget == true + ? leftWidget + : SizedBox( + width: 20.w, + height: 40.w, + ), ), - obscureText: isPwd??false, + obscureText: isPwd ?? false, + ), + Container( + height: 0.5.h, + color: Colors.grey, ), - Container(height: 0.5.h, color: Colors.grey,), ], ), ); diff --git a/star_lock/lib/tools/titleAppBar.dart b/star_lock/lib/tools/titleAppBar.dart index 449c912c..479c5929 100644 --- a/star_lock/lib/tools/titleAppBar.dart +++ b/star_lock/lib/tools/titleAppBar.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class TitleAppBar extends AppBar { - @override final Color? backgroundColor; final String? barTitle; @@ -15,26 +14,47 @@ class TitleAppBar extends AppBar { final Widget? leftWidget; List? actionsList; - TitleAppBar({Key? key,this.barTitle,this.titleColor, this.haveTitleWidget = false, this.titleWidget, this.iconColor,this.backgroundColor,this.actionsList, this.haveBack, this.haveOtherLeftWidget = false , this.leftWidget}) : super(key: key); + TitleAppBar( + {Key? key, + this.barTitle, + this.titleColor, + this.haveTitleWidget = false, + this.titleWidget, + this.iconColor, + this.backgroundColor, + this.actionsList, + this.haveBack, + this.haveOtherLeftWidget = false, + this.leftWidget}) + : super(key: key); @override _TitleAppBarState createState() => _TitleAppBarState(); - } class _TitleAppBarState extends State { @override Widget build(BuildContext context) { return AppBar( - elevation: 0, - leading:widget.haveOtherLeftWidget!?widget.leftWidget:(widget.haveBack!?IconButton( - icon: Icon(Icons.arrow_back_ios,color: widget.iconColor??Colors.white), - onPressed: () => Navigator.of(context).pop(), - ):Container()), - backgroundColor: widget.backgroundColor??Colors.white, - title: widget.haveTitleWidget!?widget.titleWidget:Text(widget.barTitle??'', style: TextStyle(color: widget.titleColor??Colors.white,fontSize: 36.sp, fontWeight:FontWeight.w500)), - centerTitle: true, - actions: widget.actionsList??[] - ); + elevation: 0, + leading: widget.haveOtherLeftWidget! + ? widget.leftWidget + : (widget.haveBack! + ? IconButton( + icon: Icon(Icons.arrow_back_ios, + color: widget.iconColor ?? Colors.white), + onPressed: () => Navigator.of(context).pop(), + ) + : Container()), + backgroundColor: widget.backgroundColor ?? Colors.white, + title: widget.haveTitleWidget! + ? widget.titleWidget + : Text(widget.barTitle ?? '', + style: TextStyle( + color: widget.titleColor ?? Colors.white, + fontSize: 28.sp, + fontWeight: FontWeight.w600)), + centerTitle: true, + actions: widget.actionsList ?? []); } } diff --git a/star_lock/lib/translations/lanKeyEntity.dart b/star_lock/lib/translations/lanKeyEntity.dart index 30d51c93..099ad663 100644 --- a/star_lock/lib/translations/lanKeyEntity.dart +++ b/star_lock/lib/translations/lanKeyEntity.dart @@ -185,6 +185,7 @@ class LanKeyEntity { this.lanChinese, this.multilingual, this.addLock, + this.addDevice, this.gateway, this.message, this.supportStaff, @@ -196,6 +197,7 @@ class LanKeyEntity { this.pushNotification, this.lockUserManagement, this.authorizedAdmin, + this.addAuthorizedAdmin, this.lockGroup, this.transferSmartLock, this.selectiveLock, @@ -225,7 +227,9 @@ class LanKeyEntity { this.safetyProblem, this.modifyAccountTip, this.pleaseEnterAccountNumber, + this.pleaseEnterNewAccountNumber, this.changeIphoneTip, + this.changeEmailTip, this.originalPassword, this.newPassword, this.surePassword, @@ -270,6 +274,7 @@ class LanKeyEntity { this.padlock, this.safeLock, this.intelligentLockCore, + this.itelligentAccessControl, this.parkingLock, this.bicycleLock, this.longRangeControl, @@ -552,6 +557,7 @@ class LanKeyEntity { lanChinese = json['lanChinese']; multilingual = json['multilingual']; addLock = json['addLock']; + addDevice = json['addDevice']; gateway = json['gateway']; message = json['message']; supportStaff = json['supportStaff']; @@ -564,6 +570,7 @@ class LanKeyEntity { pushNotification = json['pushNotification']; lockUserManagement = json['lockUserManagement']; authorizedAdmin = json['authorizedAdmin']; + addAuthorizedAdmin = json['addAuthorizedAdmin']; lockGroup = json['lockGroup']; transferSmartLock = json['transferSmartLock']; selectiveLock = json['selectiveLock']; @@ -596,7 +603,9 @@ class LanKeyEntity { safetyProblem = json['safetyProblem']; modifyAccountTip = json['modifyAccountTip']; pleaseEnterAccountNumber = json['pleaseEnterAccountNumber']; + pleaseEnterNewAccountNumber = json['pleaseEnterNewAccountNumber']; changeIphoneTip = json['changeIphoneTip']; + changeEmailTip = json['changeEmailTip']; originalPassword = json['originalPassword']; newPassword = json['newPassword']; surePassword = json['surePassword']; @@ -646,6 +655,7 @@ class LanKeyEntity { padlock = json['padlock']; safeLock = json['safeLock']; intelligentLockCore = json['intelligentLockCore']; + itelligentAccessControl = json['itelligentAccessControl']; parkingLock = json['parkingLock']; bicycleLock = json['bicycleLock']; longRangeControl = json['longRangeControl']; @@ -936,6 +946,7 @@ class LanKeyEntity { String? lanChinese; String? multilingual; String? addLock; + String? addDevice; String? gateway; String? message; String? supportStaff; @@ -948,6 +959,7 @@ class LanKeyEntity { String? pushNotification; String? lockUserManagement; String? authorizedAdmin; + String? addAuthorizedAdmin; String? lockGroup; String? transferSmartLock; String? selectiveLock; @@ -978,7 +990,9 @@ class LanKeyEntity { String? safetyProblem; String? modifyAccountTip; String? pleaseEnterAccountNumber; + String? pleaseEnterNewAccountNumber; String? changeIphoneTip; + String? changeEmailTip; String? originalPassword; String? newPassword; String? surePassword; @@ -1025,6 +1039,7 @@ class LanKeyEntity { String? padlock; String? safeLock; String? intelligentLockCore; + String? itelligentAccessControl; String? parkingLock; String? bicycleLock; String? longRangeControl; @@ -1316,6 +1331,7 @@ class LanKeyEntity { map['lanChinese'] = lanChinese; map['multilingual'] = multilingual; map['addLock'] = addLock; + map['addDevice'] = addDevice; map['gateway'] = gateway; map['message'] = message; map['supportStaff'] = supportStaff; @@ -1328,6 +1344,7 @@ class LanKeyEntity { map['pushNotification'] = pushNotification; map['lockUserManagement'] = lockUserManagement; map['authorizedAdmin'] = authorizedAdmin; + map['addAuthorizedAdmin'] = addAuthorizedAdmin; map['lockGroup'] = lockGroup; map['transferSmartLock'] = transferSmartLock; map['selectiveLock'] = selectiveLock; @@ -1361,7 +1378,9 @@ class LanKeyEntity { map['safetyProblem'] = safetyProblem; map['modifyAccountTip'] = modifyAccountTip; map['pleaseEnterAccountNumber'] = pleaseEnterAccountNumber; + map['pleaseEnterNewAccountNumber'] = pleaseEnterNewAccountNumber; map['changeIphoneTip'] = changeIphoneTip; + map['changeEmailTip'] = changeEmailTip; map['originalPassword'] = originalPassword; map['newPassword'] = newPassword; map['surePassword'] = surePassword; @@ -1409,6 +1428,7 @@ class LanKeyEntity { map['padlock'] = padlock; map['safeLock'] = safeLock; map['intelligentLockCore'] = intelligentLockCore; + map['itelligentAccessControl'] = itelligentAccessControl; map['parkingLock'] = parkingLock; map['bicycleLock'] = bicycleLock; map['longRangeControl'] = longRangeControl;