Merge branch 'master_hyx'

This commit is contained in:
anfe 2024-04-30 11:45:00 +08:00
commit 127ec95537
14 changed files with 681 additions and 370 deletions

View File

@ -251,7 +251,7 @@ class _LockDetailPageState extends State<LockDetailPage>
width: 100.r,
height: 100.r,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.9),
color: Colors.white,
borderRadius: BorderRadius.circular(100.w),
boxShadow: [
BoxShadow(

View File

@ -163,6 +163,11 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
return returnWidget;
}
//
Widget XHJBg({required Widget child}) {
return Container();
}
Widget unHaveData() {
return ListView(
children: [

View File

@ -49,155 +49,196 @@ class _AboutPageState extends State<AboutPage> {
builder: (AboutConsole logic) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.about!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.about!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Align(
alignment: Alignment.topRight,
child: GestureDetector(
onTap: logic.handleTap,
child: Container(
color: Colors.transparent,
width: 80.w,
height: 80.h,
),
),
),
SizedBox(height: 70.h),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Image.asset(
F.sw(
defaultCall: () => "images/icon_main_1024.png",
xhjCall: () => "images/icon_main_xhj_1024.png"),
width: 160.w,
height: 160.w),
]),
SizedBox(height: 20.h),
Text(
"${F.title} $version+$buildNumber",
style:
TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
SizedBox(height: 20.h),
Text(
F.apiPrefix,
style:
TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
SizedBox(
height: 60.h,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.introduce!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.introduceURL,
"title": '介绍'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.userAgreement!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.userAgreementURL,
"title": '用户协议'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.privacyPolicy!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader
.lanKeys!.personalInformationCollectionList!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.collectionListURL,
"title": '个人信息收集清单'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader
.lanKeys!.applicationPermissionDescription!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.appPermissionDescURL,
"title": '应用权限说明'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader
.lanKeys!.thirdPartyInformationSharingList!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.thirdPartyInfShareListURL,
"title": '第三方信息共享清单'.tr
});
}),
F.sw(
defaultCall: () => logoView(),
xhjCall: () => const SizedBox()),
listView(),
F.sw(
defaultCall: () => const SizedBox(),
xhjCall: () => logoView()),
],
),
);
});
}
//
Widget listView() {
Widget view = Column(
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.introduce!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.introduceURL,
"title": '介绍'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.userAgreement!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.userAgreementURL,
"title": '用户协议'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.privacyPolicy!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.privacyPolicyURL,
"title": '隐私政策'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader
.lanKeys!.personalInformationCollectionList!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.collectionListURL,
"title": '个人信息收集清单'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel:
TranslationLoader.lanKeys!.applicationPermissionDescription!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.appPermissionDescURL,
"title": '应用权限说明'.tr
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel:
TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.thirdPartyInfShareListURL,
"title": '第三方信息共享清单'.tr
});
}),
],
);
view = F.sw(
defaultCall: () => view,
xhjCall: () => Container(
margin: EdgeInsets.only(top: 20.h, left: 20.w, right: 20.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20.r))),
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: view,
),
));
return view;
}
//
Widget logoView() {
return GetBuilder<AboutConsole>(builder: (AboutConsole logic) {
return Padding(
padding: EdgeInsets.only(top: 70.h, bottom: 60.h),
child: Column(
children: [
Align(
alignment: Alignment.topRight,
child: GestureDetector(
onTap: logic.handleTap,
child: Container(
color: Colors.transparent,
width: 80.w,
height: 80.h,
),
),
),
ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: Image.asset(
F.sw(
defaultCall: () => "images/icon_main_1024.png",
xhjCall: () => "images/icon_main_xhj_1024.png"),
width: 160.w,
height: 160.w),
),
SizedBox(height: 20.h),
Text(
"${F.title} $version+$buildNumber",
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
SizedBox(height: 20.h),
Text(
F.apiPrefix,
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
],
),
);
});
}
}

View File

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/addLock/addLock/addLock_logic.dart';
import 'package:star_lock/tools/appFirstEnterHandle.dart';
import 'package:star_lock/tools/storage.dart';
@ -30,10 +31,20 @@ class _AddLockPageState extends State<AddLockPage> with BaseWidget {
builder: (AddLockLogic logic) {
return Scaffold(
backgroundColor: Colors.white,
appBar: TitleAppBar(
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.addLock!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.addLock!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: ListView(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,

View File

@ -1,10 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/flavors.dart';
import '../../../app_settings/app_colors.dart';
import '../../../blue/blue_manage.dart';
import '../../../tools/appRouteObserver.dart';
@ -27,30 +27,48 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.nearbyLock!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
CupertinoActivityIndicator(radius: 18.w, color: Colors.white,),
SizedBox(width: 30.w)
],
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.nearbyLock!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
CupertinoActivityIndicator(
radius: 18.w,
color: Colors.white,
),
SizedBox(width: 30.w)
]),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.nearbyLock!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
actionsList: [
CupertinoActivityIndicator(
radius: 18.w,
color: AppColors.blackColor,
),
SizedBox(width: 30.w)
]),
),
body: Obx(() {
return ListView.separated(
itemCount: state.devices.length,
itemBuilder: (c, index) {
return nearbyLockItem('images/icon_lockGroup_item.png', state.devices[index], () {
return nearbyLockItem(
'images/icon_lockGroup_item.png', state.devices[index], () {
// Navigator.pushNamed(context, Routers.lockAddressPage);
// logic.getPublicKey(state.devices[index].serviceUuids[0].toString());
state.selectLockName.value = state.devices[index].advertisementData.advName;
state.selectLockName.value =
state.devices[index].advertisementData.advName;
logic.connect(state.devices[index].advertisementData.advName);
// Get.toNamed(Routers.lockAddressGaoDePage);
});
@ -68,9 +86,16 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
);
}
Widget nearbyLockItem(String lockTypeIcon, ScanResult scanResult, Function() action ) {
Widget nearbyLockItem(
String lockTypeIcon, ScanResult scanResult, Function() action) {
return GestureDetector(
onTap: ((scanResult.advertisementData.serviceUuids.isNotEmpty ? scanResult.advertisementData.serviceUuids[0] : "").toString()[33] == "1") ? action : null,
onTap: ((scanResult.advertisementData.serviceUuids.isNotEmpty
? scanResult.advertisementData.serviceUuids[0]
: "")
.toString()[33] ==
"1")
? action
: null,
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
@ -92,7 +117,18 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 323300 01
Text(scanResult.advertisementData.advName, style: TextStyle(fontSize: 20.sp, color: ((scanResult.advertisementData.serviceUuids.isNotEmpty ? scanResult.advertisementData.serviceUuids[0] : "").toString()[33] == "1") ? AppColors.blackColor : Colors.grey)),
Text(scanResult.advertisementData.advName,
style: TextStyle(
fontSize: 20.sp,
color: ((scanResult.advertisementData.serviceUuids
.isNotEmpty
? scanResult.advertisementData
.serviceUuids[0]
: "")
.toString()[33] ==
"1")
? AppColors.blackColor
: Colors.grey)),
],
),
SizedBox(
@ -173,5 +209,4 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
logic.stopScanBlueList();
BlueManage().disconnect();
}
}

View File

@ -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 SelectLockTypePage extends StatefulWidget {
State<SelectLockTypePage> createState() => _SelectLockTypePageState();
}
class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget {
class _SelectLockTypePageState extends State<SelectLockTypePage>
with BaseWidget {
final logic = Get.put(SelectLockTypeLogic());
final state = Get.find<SelectLockTypeLogic>().state;
@ -26,121 +26,165 @@ class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.selectLockType!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.selectLockType!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: Column(
children: [
allLock(),
Expanded(
child: Container(
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
child: GridView.count(
crossAxisCount: 2,
childAspectRatio: 2.83,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
children: [
lockTypeItem('images/lockType/lockType_doorLock.png',
TranslationLoader.lanKeys!.doorLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 1});
}),
if (!F.isLite)
lockTypeItem('images/lockType/lockType_NFCLock.png',
TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () {
// Navigator.pushNamed(context, Routers.addLockPage);
}),
if (!F.isLite)
lockTypeItem('images/lockType/lockType_padlock.png',
TranslationLoader.lanKeys!.padlock!.tr, () {
// Navigator.pushNamed(context, Routers.addLockPage);
}),
lockTypeItem('images/lockType/lockType_safeLock.png',
TranslationLoader.lanKeys!.safeLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 4});
}),
lockTypeItem('images/lockType/lockType_parkingLock.png',
TranslationLoader.lanKeys!.parkingLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 5});
}),
lockTypeItem('images/lockType/lockType_entranceGuardLock.png',
TranslationLoader.lanKeys!.itelligentAccessControl!.tr,
() {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 6});
}),
// lockTypeItem('images/lockType/lockType_bicycleLock.png',
// TranslationLoader.lanKeys!.bicycleLock!.tr, () {
// Navigator.pushNamed(context, Routers.addLockPage);
// }),
if (!F.isLite)
lockTypeItem('images/lockType/lockType_gatewayLock.png',
TranslationLoader.lanKeys!.gateway!.tr, () {
// Navigator.pushNamed(context, Routers.gatewayListPage);
}),
if (!F.isLite)
lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头'.tr,
() {
// Navigator.pushNamed(context, Routers.gatewayListPage);
}),
],
),
),
)
lockTypeList(),
],
),
);
}
//
Widget lockTypeList() {
Widget view = F.sw(
defaultCall: () => GridView.count(
crossAxisCount: 2,
childAspectRatio: 2.83,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
children: getLockTypeList(),
),
xhjCall: () => GridView.count(
crossAxisCount: 1,
childAspectRatio: 6,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
children: getLockTypeList(),
));
return Expanded(
child: Container(
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
child: view,
),
);
}
//
List<Widget> getLockTypeList() {
return [
lockTypeItem('images/lockType/lockType_doorLock.png',
TranslationLoader.lanKeys!.doorLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 1});
}),
if (!F.isLite)
lockTypeItem('images/lockType/lockType_NFCLock.png',
TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () {
// Navigator.pushNamed(context, Routers.addLockPage);
}),
if (!F.isLite)
lockTypeItem('images/lockType/lockType_padlock.png',
TranslationLoader.lanKeys!.padlock!.tr, () {
// Navigator.pushNamed(context, Routers.addLockPage);
}),
lockTypeItem('images/lockType/lockType_safeLock.png',
TranslationLoader.lanKeys!.safeLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 4});
}),
lockTypeItem('images/lockType/lockType_parkingLock.png',
TranslationLoader.lanKeys!.parkingLock!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 5});
}),
lockTypeItem('images/lockType/lockType_entranceGuardLock.png',
TranslationLoader.lanKeys!.itelligentAccessControl!.tr, () {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 6});
}),
// lockTypeItem('images/lockType/lockType_bicycleLock.png',
// TranslationLoader.lanKeys!.bicycleLock!.tr, () {
// Navigator.pushNamed(context, Routers.addLockPage);
// }),
if (!F.isLite)
lockTypeItem('images/lockType/lockType_gatewayLock.png',
TranslationLoader.lanKeys!.gateway!.tr, () {
// Navigator.pushNamed(context, Routers.gatewayListPage);
}),
if (!F.isLite)
lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头'.tr, () {
// Navigator.pushNamed(context, Routers.gatewayListPage);
}),
];
}
//
Widget allLock() {
Widget view = Row(
children: [
SizedBox(width: 30.w),
Image.asset(
'images/lockType/lockType_allLocks.png',
width: 88.w,
height: 80.w,
),
SizedBox(width: 40.w),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(TranslationLoader.lanKeys!.allLock!.tr,
style: TextStyle(
fontSize: 24.sp,
)),
Text(TranslationLoader.lanKeys!.searchAllLockType!.tr,
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor)),
],
),
),
SizedBox(width: 40.w),
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
),
SizedBox(width: 40.w),
],
);
//
view = F.sw(
defaultCall: () => Container(
height: 150.h,
color: Colors.white,
margin: const EdgeInsets.all(10),
child: view,
),
xhjCall: () => Container(
height: 150.h,
margin: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: AppColors.mainColor, width: 1),
borderRadius: BorderRadius.circular(20.r),
),
child: view,
));
return GestureDetector(
onTap: () {
Navigator.pushNamed(context, Routers.addLockPage,
arguments: {'getLockType': 0});
},
child: Container(
height: 150.h,
color: Colors.white,
margin: const EdgeInsets.all(10),
child: Row(
children: [
SizedBox(width: 30.w),
Image.asset(
'images/lockType/lockType_allLocks.png',
width: 88.w,
height: 80.w,
),
SizedBox(width: 40.w),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(TranslationLoader.lanKeys!.allLock!.tr,
style: TextStyle(
fontSize: 24.sp,
)),
Text(TranslationLoader.lanKeys!.searchAllLockType!.tr,
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor)),
],
),
),
SizedBox(width: 40.w),
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
),
SizedBox(width: 40.w),
],
),
),
child: view,
);
}
@ -150,8 +194,14 @@ class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget
onTap: action,
child: Container(
height: 120.h,
color: Colors.white,
// margin: EdgeInsets.all(10),
decoration: F.sw(
defaultCall: () => const BoxDecoration(
color: Colors.white,
),
xhjCall: () => BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.r),
)),
child: Row(
children: [
SizedBox(width: 30.w),

View File

@ -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/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/mineUnbindPhoneOrEmail_logic.dart';
import 'package:star_lock/tools/tf_input_haveBorder.dart';
@ -26,10 +27,20 @@ class _MineUnbindPhoneOrEmailState extends State<MineUnbindPhoneOrEmailPage> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.modifyAccount!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.modifyAccount!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: Column(
children: [
Container(

View File

@ -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/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccountNext/minePersonInfoEditAccountNext_logic.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart';
@ -25,10 +26,20 @@ class _MinePersonInfoEditAccountNextPageState
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.modifyAccount!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.modifyAccount!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: Column(
children: [
Container(

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditName/MinePersonInfoEditName_logic.dart';
import '../../../app_settings/app_colors.dart';
@ -25,45 +26,89 @@ class _MinePersonInfoEditNamePageState
@override
Widget build(BuildContext context) {
return Scaffold(
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),
backgroundColor: AppColors.greyBackgroundColor,
appBar: F.sw(
defaultCall: () => 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: () {
if (state.nickNameIsOK == false) {
logic.showToast("请输入昵称");
} else {
logic.updateUserInfoRequest();
}
},
),
onPressed: () {
if (state.nickNameIsOK == false) {
logic.showToast("请输入昵称");
} else {
logic.updateUserInfoRequest();
}
},
),
],
],
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.changeNickName!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
actionsList: [
TextButton(
child: Text(
TranslationLoader.lanKeys!.save!.tr,
style:
TextStyle(color: AppColors.blackColor, fontSize: 24.sp),
),
onPressed: () {
if (state.nickNameIsOK == false) {
logic.showToast("请输入昵称");
} else {
logic.updateUserInfoRequest();
}
},
),
],
),
),
body: Container(
padding: EdgeInsets.all(15.w),
child: Column(
children: [
LoginInput(
controller: state.nickNameController,
onchangeAction: (textStr) {
logic.checkNext(state.nickNameController);
},
isPwd: false,
leftWidget: SizedBox(width: 15.w),
hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.nickName!.tr}",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
],
),
child: listView(),
));
}
Widget listView() {
Widget view = Column(
mainAxisSize: MainAxisSize.min,
children: [
LoginInput(
controller: state.nickNameController,
onchangeAction: (textStr) {
logic.checkNext(state.nickNameController);
},
isPwd: false,
leftWidget: SizedBox(width: 15.w),
hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.nickName!.tr}",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
],
);
view = F.sw(
defaultCall: () => view,
xhjCall: () => Container(
margin: EdgeInsets.only(top: 20.h, left: 16.w, right: 16.w),
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20.r))),
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: view,
),
));
return view;
}
}

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/mineBindPhoneOrEmail_logic.dart';
import '../../../appRouters.dart';
@ -28,12 +29,24 @@ class _MineBindPhoneOrEmailPageState extends State<MineBindPhoneOrEmailPage> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: state.channel.value == "1"
? TranslationLoader.lanKeys!.mobileNumber!.tr
: TranslationLoader.lanKeys!.email!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: state.channel.value == "1"
? TranslationLoader.lanKeys!.mobileNumber!.tr
: TranslationLoader.lanKeys!.email!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 10.h, left: 30.w, right: 30.w),
@ -58,11 +71,12 @@ class _MineBindPhoneOrEmailPageState extends State<MineBindPhoneOrEmailPage> {
rightWidget: Text(
'${state.countryName.value} +${state.countryCode.value}',
textAlign: TextAlign.end,
style:
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
style: TextStyle(
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
),
action: () async {
var result = await Get.toNamed(Routers.selectCountryRegionPage);
var result =
await Get.toNamed(Routers.selectCountryRegionPage);
if (result != null) {
result as Map<String, dynamic>;
state.countryCode.value = result['code'];
@ -105,7 +119,8 @@ class _MineBindPhoneOrEmailPageState extends State<MineBindPhoneOrEmailPage> {
),
Obx(() => GestureDetector(
onTap: () {
if (state.accountIsOK.value && state.canResend.value) {
if (state.accountIsOK.value &&
state.canResend.value) {
logic.sendValidationCode();
}
},

View File

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart';
import '../../../appRouters.dart';
@ -29,64 +29,25 @@ class _MinePersonInfoResetPasswordPageState
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.resetPasswords!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.resetPasswords!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: Container(
margin: EdgeInsets.only(left: 30.w, right: 30.w),
child: Column(
children: [
LoginInput(
controller: state.oldPwdController,
onchangeAction: (textStr) {
logic.changeInput(state.oldPwdController);
},
isPwd: true,
leftWidget: Text(
"${TranslationLoader.lanKeys!.originalPassword!.tr} ",
style: TextStyle(fontSize: 22.sp),
),
hintText: "",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
LoginInput(
controller: state.newPwdController,
onchangeAction: (textStr) {
logic.changeInput(state.newPwdController);
},
isPwd: true,
leftWidget: Text(
"${TranslationLoader.lanKeys!.newPassword!.tr} ",
style: TextStyle(fontSize: 22.sp),
),
hintText: "",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
LoginInput(
controller: state.surePwdController,
onchangeAction: (textStr) {
logic.changeInput(state.surePwdController);
},
isPwd: true,
// isHaveLeftWidget: false,
leftWidget: Text(
"${TranslationLoader.lanKeys!.surePassword!.tr} ",
style: TextStyle(fontSize: 22.sp),
),
hintText: "",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
Container(
width: 1.sw,
padding: EdgeInsets.only(top: 15.h, bottom: 10.h),
child: Text(
TranslationLoader.lanKeys!.registerPasswordTip!.tr,
style: TextStyle(
fontSize: 18.w, color: AppColors.darkGrayTextColor))),
loginView(),
SizedBox(height: 50.w),
Obx(() => SubmitBtn(
btnName: TranslationLoader.lanKeys!.save!.tr,
@ -123,4 +84,76 @@ class _MinePersonInfoResetPasswordPageState
),
));
}
Widget loginView() {
Widget view = Column(
children: [
LoginInput(
controller: state.oldPwdController,
onchangeAction: (textStr) {
logic.changeInput(state.oldPwdController);
},
isPwd: true,
leftWidget: Text(
"${TranslationLoader.lanKeys!.originalPassword!.tr} ",
style: TextStyle(fontSize: 22.sp),
),
hintText: "",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
LoginInput(
controller: state.newPwdController,
onchangeAction: (textStr) {
logic.changeInput(state.newPwdController);
},
isPwd: true,
leftWidget: Text(
"${TranslationLoader.lanKeys!.newPassword!.tr} ",
style: TextStyle(fontSize: 22.sp),
),
hintText: "",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
LoginInput(
controller: state.surePwdController,
onchangeAction: (textStr) {
logic.changeInput(state.surePwdController);
},
isPwd: true,
// isHaveLeftWidget: false,
leftWidget: Text(
"${TranslationLoader.lanKeys!.surePassword!.tr} ",
style: TextStyle(fontSize: 22.sp),
),
hintText: "",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
Container(
width: 1.sw,
padding: EdgeInsets.only(top: 15.h, bottom: 10.h),
child: Text(TranslationLoader.lanKeys!.registerPasswordTip!.tr,
style: TextStyle(
fontSize: 18.w, color: AppColors.darkGrayTextColor))),
],
);
view = F.sw(
defaultCall: () => view,
xhjCall: () => Container(
margin: EdgeInsets.only(
top: 20.h,
),
padding: EdgeInsets.all(16.r),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20.r))),
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: view,
),
));
return view;
}
}

View File

@ -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/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoSetSafetyProblem/minePersonInfoSetSafetyProblem_entity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoSetSafetyProblem/minePersonInfoSetSafetyProblem_logic.dart';
import 'package:star_lock/tools/custom_bottom_sheet.dart';
@ -35,10 +36,20 @@ class _MinePersonInfoSetSafetyProblemPageState
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.safetyProblem!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.safetyProblem!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: ListView(
children: [
Container(
@ -93,7 +104,7 @@ class _MinePersonInfoSetSafetyProblemPageState
Widget _safityProblemItem(String problemTitle, String answerTitle,
TextEditingController controller, Function() action) {
return Column(
Widget view = Column(
children: [
CommonItem(
leftTitel: problemTitle,
@ -125,6 +136,19 @@ class _MinePersonInfoSetSafetyProblemPageState
)
],
);
view = F.sw(
defaultCall: () => view,
xhjCall: () => Container(
margin: EdgeInsets.only(top: 20.h, left: 20.w, right: 20.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20.r))),
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: view,
),
));
return view;
}
Future _selectProblemBottomSheet(List dataList, int problemIndex) async {

View File

@ -53,16 +53,44 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
appBar: F.sw(
defaultCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
)),
body: SingleChildScrollView(
child: getListDataView(),
child: styleHierarchy(),
),
);
}
//
Widget styleHierarchy() {
Widget view = getListDataView();
view = F.sw(
defaultCall: () => view,
xhjCall: () => Container(
margin: EdgeInsets.only(
top: 20.h, left: 20.w, right: 20.w, bottom: 40.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20.r))),
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: view,
),
));
return view;
}
Widget getListDataView() {
return Column(
children: [
@ -283,6 +311,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
SubmitBtn(
btnName: TranslationLoader.lanKeys!.logout!.tr,
isDelete: true,
padding: EdgeInsets.symmetric(horizontal: 15.w),
onClick: () {
//退
ShowTipView().showIosTipWithContentDialog("确定要退出吗?".tr, () {

View File

@ -31,6 +31,7 @@ class SubmitBtn extends StatelessWidget {
bool? isDelete;
bool? isDisabled;
SubmitBtn({
Key? key,
required this.btnName,
@ -48,7 +49,7 @@ class SubmitBtn extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
return Container(
width: ScreenUtil().screenWidth - 40.w,
height: 60.h,
child: ElevatedButton(