172 lines
5.1 KiB
Dart
Raw Normal View History

2023-07-11 18:37:25 +08:00
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/showBottomSheetTool.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class CheckingInAddStaffPage extends StatefulWidget {
2023-07-15 15:11:28 +08:00
const CheckingInAddStaffPage({Key? key}) : super(key: key);
2023-07-11 18:37:25 +08:00
@override
State<CheckingInAddStaffPage> createState() => _CheckingInAddStaffPageState();
}
class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle:
"${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.staff!.tr}",
haveBack: true,
backgroundColor: AppColors.mainColor),
2023-07-11 18:37:25 +08:00
body: Column(
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
rightWidget:
getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr)),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.punchingMode!.tr,
rightTitle: "APP",
isHaveLine: false,
isHaveDirection: true,
action: () {
_showSeletClockInType();
2023-07-11 18:37:25 +08:00
}),
SizedBox(
height: 10.h,
),
CommonItem(
leftTitel:
TranslationLoader.lanKeys!.whetherTheEmployeeHasAKey!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: Row(
children: [
whetherTheEmployeeHasAKeyWidget("", () {}),
SizedBox(
width: 30.w,
),
whetherTheEmployeeHasAKeyWidget("", () {}),
],
)),
2023-07-11 18:37:25 +08:00
Visibility(
visible: true,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
rightWidget:
getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr)),
2023-07-11 18:37:25 +08:00
),
Visibility(
visible: true,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.selectKey!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
action: () {
_showSeletClockInType();
}),
2023-07-11 18:37:25 +08:00
),
SizedBox(
height: 50.w,
2023-07-11 18:37:25 +08:00
),
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: () {}),
2023-07-11 18:37:25 +08:00
],
),
);
}
Widget getTFWidget(String tfStr) {
2023-07-11 18:37:25 +08:00
return Container(
height: 50.h,
2023-07-13 14:13:44 +08:00
width: 300.w,
// color: Colors.red,
2023-07-11 18:37:25 +08:00
child: Row(
children: [
Expanded(
child: TextField(
//输入框一行
maxLines: 1,
// controller: _controller,
autofocus: false,
textAlign: TextAlign.end,
2023-07-11 18:37:25 +08:00
decoration: InputDecoration(
//输入里面输入文字内边距设置
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
hintText: tfStr,
hintStyle: TextStyle(fontSize: 22.sp),
2023-07-11 18:37:25 +08:00
//不需要输入框下划线
border: InputBorder.none,
),
),
),
],
),
);
}
void _showSeletClockInType() {
var list = [
"15080825640",
];
ShowBottomSheetTool().showSingleRowPicker(
//上下文
2023-07-11 18:37:25 +08:00
context,
//默认的索引
normalIndex: 0,
title: "选择钥匙",
2023-07-15 15:11:28 +08:00
cancelTitle: TranslationLoader.lanKeys!.cancel!.tr,
sureTitle: TranslationLoader.lanKeys!.sure!.tr,
2023-07-11 18:37:25 +08:00
//要显示的列表
//可自定义数据适配器
//adapter: PickerAdapter(),
data: list,
//选择事件的回调
clickCallBack: (int index, var str) {});
2023-07-11 18:37:25 +08:00
}
Widget whetherTheEmployeeHasAKeyWidget(String title, Function action) {
2023-07-11 18:37:25 +08:00
return GestureDetector(
onTap: () {},
2023-07-11 18:37:25 +08:00
child: Row(
children: [
Image.asset(
'images/icon_round_unSelet.png',
width: 26.w,
height: 26.w,
),
SizedBox(
width: 5.w,
),
Text(
title,
style: TextStyle(
fontSize: 22.sp,
),
),
],
2023-07-11 18:37:25 +08:00
),
);
}
}