142 lines
4.3 KiB
Dart
142 lines
4.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../../../app_settings/app_colors.dart';
|
|
import '../../../../tools/commonItem.dart';
|
|
import '../../../../tools/submitBtn.dart';
|
|
import '../../../../tools/titleAppBar.dart';
|
|
import '../../../../translations/trans_lib.dart';
|
|
|
|
class ElectronicKeyPeriodValidityPage extends StatefulWidget {
|
|
const ElectronicKeyPeriodValidityPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<ElectronicKeyPeriodValidityPage> createState() => _ElectronicKeyPeriodValidityPageState();
|
|
}
|
|
|
|
class _ElectronicKeyPeriodValidityPageState extends State<ElectronicKeyPeriodValidityPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.periodValidity!.tr, haveBack:true, backgroundColor: AppColors.mainColor),
|
|
body: Column(
|
|
children: [
|
|
topWidget(),
|
|
SizedBox(height: 10.h,),
|
|
bottomWidget()
|
|
],
|
|
)
|
|
);
|
|
}
|
|
|
|
Widget topWidget(){
|
|
return Container(
|
|
height: 150.h,
|
|
width: 1.sw,
|
|
color: Colors.white,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
height: 60.h,
|
|
// color: Colors.red,
|
|
padding: EdgeInsets.only(left:15.h, top: 15.h),
|
|
child: Text(TranslationLoader.lanKeys!.periodValidity!.tr, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w600))
|
|
),
|
|
Container(
|
|
height: 90.h,
|
|
child: GridView.builder(
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
crossAxisCount: 7,
|
|
childAspectRatio: 1.0
|
|
),
|
|
itemCount: 7,
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
itemBuilder: (context,index){
|
|
return btnItem(index);
|
|
})
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget btnItem(int index){
|
|
String dateStr;
|
|
switch (index) {
|
|
case 0:
|
|
dateStr = TranslationLoader.lanKeys!.sundayShort!.tr;
|
|
break;
|
|
case 1:
|
|
dateStr = TranslationLoader.lanKeys!.mondayShort!.tr;
|
|
break;
|
|
case 2:
|
|
dateStr = TranslationLoader.lanKeys!.tuesdayShort!.tr;
|
|
break;
|
|
case 3:
|
|
dateStr = TranslationLoader.lanKeys!.wednesdayShort!.tr;
|
|
break;
|
|
case 4:
|
|
dateStr = TranslationLoader.lanKeys!.thursdayShort!.tr;
|
|
break;
|
|
case 5:
|
|
dateStr = TranslationLoader.lanKeys!.fridayShort!.tr;
|
|
break;
|
|
case 6:
|
|
dateStr = TranslationLoader.lanKeys!.saturdayShort!.tr;
|
|
break;
|
|
default:
|
|
dateStr = "";
|
|
break;
|
|
}
|
|
return GestureDetector(
|
|
onTap: (){
|
|
|
|
},
|
|
child: Container(
|
|
width: 70.h,
|
|
height: 70.h,
|
|
margin: EdgeInsets.all(10.h),
|
|
decoration: BoxDecoration(
|
|
// color: Colors.blue,
|
|
border: Border.all(width: 1, color: Colors.grey),
|
|
borderRadius: BorderRadius.circular(60.w),
|
|
),
|
|
child: Center(child: Text(dateStr)),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget bottomWidget(){
|
|
return Column(
|
|
children: [
|
|
CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveTime!.tr, rightTitle:"", isHaveDirection: true, isHaveLine: true, action:(){
|
|
|
|
}),
|
|
CommonItem(leftTitel:TranslationLoader.lanKeys!.failureTime!.tr, rightTitle:"", isHaveDirection: true, action:(){
|
|
|
|
}),
|
|
Container(height: 10.h),
|
|
CommonItem(leftTitel:TranslationLoader.lanKeys!.effectiveDate!.tr, rightTitle:"", isHaveDirection: true, isHaveLine: true, action:(){
|
|
|
|
}),
|
|
CommonItem(leftTitel:TranslationLoader.lanKeys!.failureDate!.tr, rightTitle:"", isHaveDirection: true, action:(){
|
|
|
|
}),
|
|
Container(height: 40.h),
|
|
SubmitBtn(
|
|
btnName: TranslationLoader.lanKeys!.sure!.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: (){
|
|
// Navigator.pushNamed(context, Routers.nearbyLockPage);
|
|
}
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|