|
@@ -0,0 +1,590 @@
|
|
|
+import 'package:cs_resources/constants/color_constants.dart';
|
|
|
+import 'package:cs_resources/generated/assets.dart';
|
|
|
+import 'package:flutter/cupertino.dart';
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter/services.dart';
|
|
|
+import 'package:flutter/widgets.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
+import 'package:plugin_basic/base/base_state.dart';
|
|
|
+import 'package:plugin_basic/base/base_stateful_page.dart';
|
|
|
+import 'package:plugin_basic/utils/ext_get_nav.dart';
|
|
|
+import 'package:router/path/router_path.dart';
|
|
|
+import 'package:shared/utils/date_time_utils.dart';
|
|
|
+import 'package:shared/utils/screen_util.dart';
|
|
|
+import 'package:widgets/ext/ex_widget.dart';
|
|
|
+import 'package:widgets/my_appbar.dart';
|
|
|
+import 'package:widgets/my_button.dart';
|
|
|
+import 'package:widgets/my_load_image.dart';
|
|
|
+import 'package:widgets/my_text_view.dart';
|
|
|
+import 'package:widgets/no_shadow_scroll_behavior.dart';
|
|
|
+import 'package:widgets/shatter/form_require_text.dart';
|
|
|
+import 'package:widgets/shatter/round_my_text_field.dart';
|
|
|
+import 'package:widgets/widget_export.dart';
|
|
|
+
|
|
|
+import 'labour_request_er_add_controller.dart';
|
|
|
+import 'labour_request_er_add_state.dart';
|
|
|
+
|
|
|
+class LabourRequestERAddPage extends BaseStatefulPage<LabourRequestERAddController> {
|
|
|
+ LabourRequestERAddPage({Key? key}) : super(key: key);
|
|
|
+
|
|
|
+ //启动当前页面,pageType 0 是新增 1是编辑 2是详情
|
|
|
+ static void startInstance(int pageType, String? appliedId, void Function(dynamic value)? cb) {
|
|
|
+ return Get.start(RouterPath.THLabourRequestERAdd, arguments: {'pageType': pageType, 'appliedId': appliedId, 'cb': cb});
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ LabourRequestERAddController createRawController() {
|
|
|
+ return LabourRequestERAddController();
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ State<LabourRequestERAddPage> createState() => _LabourRequestAddState();
|
|
|
+}
|
|
|
+
|
|
|
+class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourRequestERAddController> {
|
|
|
+ late LabourRequestERAddState state;
|
|
|
+
|
|
|
+ @override
|
|
|
+ void initState() {
|
|
|
+ super.initState();
|
|
|
+ state = controller.state;
|
|
|
+ state.pageType = Get.arguments['pageType'];
|
|
|
+ state.requestId = Get.arguments['appliedId'];
|
|
|
+ state.cb = Get.arguments['cb'] as void Function(dynamic)?;
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return autoCtlGetBuilder(builder: (controller) {
|
|
|
+ return Scaffold(
|
|
|
+ extendBodyBehindAppBar: true,
|
|
|
+ appBar: MyAppBar.appBar(context, state.pageType == 2 ? "Edit Labour Requisition".tr : "Labour Requisition".tr),
|
|
|
+ body: SafeArea(
|
|
|
+ bottom: MediaQuery.of(context).padding.bottom > 38,
|
|
|
+ top: false,
|
|
|
+ child: Container(
|
|
|
+ width: double.infinity,
|
|
|
+ height: double.infinity,
|
|
|
+ padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [
|
|
|
+ Color(0xFF091D44),
|
|
|
+ Color(0xFF245A8A),
|
|
|
+ Color(0xFF7F7CEC),
|
|
|
+ ],
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Scrollbar(
|
|
|
+ child: ScrollConfiguration(
|
|
|
+ behavior: NoShadowScrollBehavior(),
|
|
|
+ child: SingleChildScrollView(
|
|
|
+ scrollDirection: Axis.vertical,
|
|
|
+ physics: const BouncingScrollPhysics(),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ //工作标题,选择模板
|
|
|
+ FormRequireText(
|
|
|
+ text: "Job Title".tr,
|
|
|
+ ).marginOnly(top: 15),
|
|
|
+
|
|
|
+ //工作标题
|
|
|
+ Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectTitleName ?? "",
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Choose Job Title".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickJobTitle();
|
|
|
+ }),
|
|
|
+
|
|
|
+ //选择工作时间
|
|
|
+ FormRequireText(
|
|
|
+ text: "Job Time".tr,
|
|
|
+ ).marginOnly(top: 15),
|
|
|
+
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ //选择工作开始时间
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectedStartTime == null ? "" : DateTimeUtils.formatDate(state.selectedStartTime, format: "yyyy-MM-dd HH:mm"),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Job Start Time".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickStartTime();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+
|
|
|
+ //选择工作结束时间
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(left: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectedEndTime == null ? "" : DateTimeUtils.formatDate(state.selectedEndTime, format: "yyyy-MM-dd HH:mm"),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Job End Time".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickEndTime();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 10),
|
|
|
+
|
|
|
+ //选择重复时间
|
|
|
+ MyTextView("Repeat".tr, fontSize: 15, textColor: Colors.white, isFontRegular: true, marginTop: 15),
|
|
|
+
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ //选择工作开始时间
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectedRepeatStartTime == null ? "" : DateTimeUtils.formatDate(state.selectedRepeatStartTime, format: "yyyy-MM-dd"),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Repeat Start Time".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickRepeatStartTime();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+
|
|
|
+ //选择工作结束时间
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(left: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectedRepeatEndTime == null ? "" : DateTimeUtils.formatDate(state.selectedRepeatEndTime, format: "yyyy-MM-dd"),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Repeat End Time".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickRepeatEndTime();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 10),
|
|
|
+
|
|
|
+ //工作选择部门
|
|
|
+ FormRequireText(
|
|
|
+ text: "Outlet".tr,
|
|
|
+ ).marginOnly(top: 15),
|
|
|
+
|
|
|
+ //选择部门
|
|
|
+ Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectOutletName ?? "",
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Choose Outlet".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickOutlet();
|
|
|
+ }),
|
|
|
+
|
|
|
+ FormRequireText(
|
|
|
+ text: "No. of Staff".tr,
|
|
|
+ ).marginOnly(top: 15, bottom: 10),
|
|
|
+
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(right: 12),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.genderOptions[state.genderOptionType],
|
|
|
+ fontSize: 14,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ controller.pickLimitType();
|
|
|
+ }).expanded(flex: 55),
|
|
|
+
|
|
|
+ //输入框-不限制性别
|
|
|
+ Visibility(
|
|
|
+ visible: state.genderOptionType == 0,
|
|
|
+ child: CustomTextField(
|
|
|
+ formKey: "need_no",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ).expanded(flex: 55),
|
|
|
+ ),
|
|
|
+
|
|
|
+ //输入框组-限制性别
|
|
|
+ Visibility(
|
|
|
+ visible: state.genderOptionType != 0,
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "M",
|
|
|
+ fontSize: 15,
|
|
|
+ paddingLeft: 10,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ),
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "need_male",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ paddingLeft: 10,
|
|
|
+ paddingRight: 10,
|
|
|
+ height: 45,
|
|
|
+ cornerRadius: 0,
|
|
|
+ fillBackgroundColor: Colors.transparent,
|
|
|
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ .decorated(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ )
|
|
|
+ .expanded(),
|
|
|
+ const SizedBox(width: 12),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "F",
|
|
|
+ fontSize: 15,
|
|
|
+ paddingLeft: 10,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ),
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "need_female",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ paddingLeft: 10,
|
|
|
+ paddingRight: 10,
|
|
|
+ height: 45,
|
|
|
+ cornerRadius: 0,
|
|
|
+ fillBackgroundColor: Colors.transparent,
|
|
|
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ .decorated(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ )
|
|
|
+ .expanded(),
|
|
|
+ ],
|
|
|
+ ).expanded(flex: 55),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+
|
|
|
+ //输入类型
|
|
|
+ MyTextView("Event".tr, fontSize: 15, textColor: Colors.white, isFontRegular: true, marginTop: 15, marginBottom: 10),
|
|
|
+
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "event_name",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 15,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ).expanded(),
|
|
|
+
|
|
|
+ //类型
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "event_type",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+
|
|
|
+ //输入Remark
|
|
|
+ MyTextView(
|
|
|
+ "Remark".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+
|
|
|
+ IgnoreKeyboardDismiss(
|
|
|
+ child: Container(
|
|
|
+ height: 160,
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
+ padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: TextField(
|
|
|
+ cursorColor: ColorConstants.white,
|
|
|
+ cursorWidth: 1.5,
|
|
|
+ autofocus: false,
|
|
|
+ enabled: state.pageType != 2,
|
|
|
+ focusNode: state.formData["remark"]!['focusNode'],
|
|
|
+ controller: state.formData["remark"]!['controller'],
|
|
|
+ // 装饰
|
|
|
+ decoration: InputDecoration(
|
|
|
+ isDense: true,
|
|
|
+ isCollapsed: true,
|
|
|
+ border: InputBorder.none,
|
|
|
+ hintText: state.formData["remark"]!['hintText'],
|
|
|
+ hintStyle: const TextStyle(
|
|
|
+ color: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 15.0,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ style: const TextStyle(
|
|
|
+ color: ColorConstants.white,
|
|
|
+ fontSize: 15.0,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ // 键盘动作右下角图标
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmitted: (value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ).marginOnly(bottom: 30),
|
|
|
+
|
|
|
+ //提交按钮
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: MyButton(
|
|
|
+ type: ClickType.throttle,
|
|
|
+ milliseconds: 500,
|
|
|
+ onPressed: () {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ controller.doEditSubmit();
|
|
|
+ },
|
|
|
+ text: "Submit".tr,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ fontSize: 16,
|
|
|
+ radius: 22.5,
|
|
|
+ backgroundColor: hexToColor("#FFBB1B"),
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ).marginOnly(bottom: 30),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).paddingOnly(left: 15, right: 15),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|