197 lines
6.4 KiB
Dart
197 lines
6.4 KiB
Dart
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';
|
|
|
|
class LockDetailPage extends StatefulWidget {
|
|
const LockDetailPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<LockDetailPage> createState() => _LockDetailPageState();
|
|
}
|
|
|
|
class _LockDetailPageState extends State<LockDetailPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.white,
|
|
appBar: TitleAppBar(
|
|
barTitle: TranslationLoader.lanKeys!.starLock!.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor),
|
|
body: Column(
|
|
children: [topWidget(), Expanded(child: bottomWidget())],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget topWidget() {
|
|
return Column(
|
|
children: [
|
|
SizedBox(height: 40.h),
|
|
Stack(
|
|
alignment: Alignment.centerRight,
|
|
children: [
|
|
Align(
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"MCBN01-ea9240",
|
|
style:
|
|
TextStyle(fontSize: 36.sp, fontWeight: FontWeight.w500),
|
|
)),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
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(height: 40.h),
|
|
Container(
|
|
width: 1.sw,
|
|
height: 280.w,
|
|
child: Stack(
|
|
children: [
|
|
Center(
|
|
child: Image.asset('images/main/icon_main_openLockBtn.png',
|
|
width: 280.w, height: 280.w)),
|
|
Align(
|
|
alignment: const Alignment(0.5, 1),
|
|
child: Image.asset(
|
|
'images/main/icon_main_remoteUnlocking.png',
|
|
width: 90.w,
|
|
height: 90.w,
|
|
)),
|
|
],
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 40.h,
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr,
|
|
style: TextStyle(
|
|
fontSize: 24.sp,
|
|
color: const Color(0xFFB3B3B3),
|
|
fontWeight: FontWeight.w500),
|
|
),
|
|
],
|
|
),
|
|
SizedBox(
|
|
height: 40.h,
|
|
),
|
|
Divider(
|
|
height: 1,
|
|
color: const Color(0xFFB3B3B3),
|
|
indent: 20.w,
|
|
endIndent: 20.w,
|
|
)
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget bottomWidget() {
|
|
return Container(
|
|
margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 25.h),
|
|
// color: Colors.blue,
|
|
child: SizedBox(
|
|
child: GridView.count(
|
|
crossAxisCount: 4,
|
|
// childAspectRatio: 3,
|
|
crossAxisSpacing: 20.w,
|
|
mainAxisSpacing: 10.h,
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
children: [
|
|
bottomItem('images/main/icon_main_clockingIn.png',
|
|
TranslationLoader.lanKeys!.checkingIn!.tr, () {
|
|
Navigator.pushNamed(context, Routers.checkingInListPage);
|
|
}),
|
|
bottomItem('images/main/icon_main_electronicKey.png',
|
|
TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
|
Navigator.pushNamed(context, Routers.electronicKeyListPage);
|
|
}),
|
|
bottomItem('images/main/icon_main_password.png',
|
|
TranslationLoader.lanKeys!.password!.tr, () {
|
|
Navigator.pushNamed(context, Routers.passwordKeyListPage);
|
|
}),
|
|
bottomItem('images/main/icon_main_icCard.png',
|
|
TranslationLoader.lanKeys!.card!.tr, () {
|
|
Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
|
arguments: 0);
|
|
}),
|
|
bottomItem('images/main/icon_main_fingerprint.png',
|
|
TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
|
Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
|
arguments: 1);
|
|
}),
|
|
bottomItem('images/main/icon_main_remoteControl.png',
|
|
TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
|
Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
|
arguments: 2);
|
|
}),
|
|
bottomItem('images/main/icon_main_authorizedAdmin.png',
|
|
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
|
|
Navigator.pushNamed(context, Routers.authorizedAdminListPage);
|
|
}),
|
|
bottomItem('images/main/icon_main_operatingRecord.png',
|
|
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
|
Navigator.pushNamed(context, Routers.lockOperatingRecordPage);
|
|
}),
|
|
bottomItem('images/main/icon_main_set.png',
|
|
TranslationLoader.lanKeys!.set!.tr, () {
|
|
Navigator.pushNamed(context, Routers.lockSetPage);
|
|
}),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget bottomItem(String iconUrl, String name, Function() onClick) {
|
|
var width = 65.w;
|
|
var height = 70.h;
|
|
return GestureDetector(
|
|
onTap: onClick,
|
|
child: Container(
|
|
// height: 300.h,
|
|
color: Colors.white,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SizedBox(
|
|
width: width,
|
|
height: height,
|
|
child: Image.asset(iconUrl,
|
|
width: width, height: height, fit: BoxFit.fitWidth),
|
|
),
|
|
SizedBox(height: 15.w),
|
|
Expanded(
|
|
child: Text(name,
|
|
style: TextStyle(
|
|
fontSize: 25.sp, color: const Color(0xff333333)),
|
|
textAlign: TextAlign.center))
|
|
],
|
|
)),
|
|
);
|
|
}
|
|
}
|