|
@@ -1,19 +1,17 @@
|
|
import 'package:cs_resources/generated/assets.dart';
|
|
import 'package:cs_resources/generated/assets.dart';
|
|
import 'package:cs_resources/generated/l10n.dart';
|
|
import 'package:cs_resources/generated/l10n.dart';
|
|
import 'package:cs_resources/theme/app_colors_theme.dart';
|
|
import 'package:cs_resources/theme/app_colors_theme.dart';
|
|
-import 'package:domain/entity/id_name_entity.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:auto_route/auto_route.dart';
|
|
import 'package:auto_route/auto_route.dart';
|
|
-import 'package:flutter_hooks/flutter_hooks.dart';
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:router/ext/auto_router_extensions.dart';
|
|
import 'package:router/ext/auto_router_extensions.dart';
|
|
-import 'package:shared/utils/log_utils.dart';
|
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
import 'package:widgets/my_appbar.dart';
|
|
import 'package:widgets/my_appbar.dart';
|
|
import 'package:widgets/my_button.dart';
|
|
import 'package:widgets/my_button.dart';
|
|
import 'package:widgets/my_load_image.dart';
|
|
import 'package:widgets/my_load_image.dart';
|
|
import 'package:widgets/my_text_field.dart';
|
|
import 'package:widgets/my_text_field.dart';
|
|
import 'package:widgets/my_text_view.dart';
|
|
import 'package:widgets/my_text_view.dart';
|
|
|
|
+import 'package:widgets/shatter/picker_container.dart';
|
|
import 'package:widgets/widget_export.dart';
|
|
import 'package:widgets/widget_export.dart';
|
|
|
|
|
|
import '../../router/page/auth_page_router.dart';
|
|
import '../../router/page/auth_page_router.dart';
|
|
@@ -62,93 +60,118 @@ class SelectUnitPage extends HookConsumerWidget {
|
|
height: 162,
|
|
height: 162,
|
|
).marginOnly(top: 28, bottom: 18),
|
|
).marginOnly(top: 28, bottom: 18),
|
|
|
|
|
|
- Row(
|
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
|
- children: [
|
|
|
|
- //街区
|
|
|
|
- Column(
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
- children: [
|
|
|
|
- MyTextView(
|
|
|
|
- S.current.block,
|
|
|
|
- marginBottom: 9,
|
|
|
|
- textColor: context.appColors.textBlack,
|
|
|
|
- fontSize: 16,
|
|
|
|
- isFontMedium: true,
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- // 表单 - 街区
|
|
|
|
- _buildInputLayout(
|
|
|
|
- context,
|
|
|
|
- state,
|
|
|
|
- "block",
|
|
|
|
- textInputType: TextInputType.text,
|
|
|
|
- textInputAction: TextInputAction.next,
|
|
|
|
- onSubmit: (formKey, value) {
|
|
|
|
- state.formData[formKey]!['focusNode'].unfocus();
|
|
|
|
- FocusScope.of(context).requestFocus(state.formData['unit']!['focusNode']);
|
|
|
|
- },
|
|
|
|
- ).constrained(width: 88),
|
|
|
|
- ],
|
|
|
|
- ),
|
|
|
|
|
|
+ // Row(
|
|
|
|
+ // mainAxisSize: MainAxisSize.min,
|
|
|
|
+ // children: [
|
|
|
|
+ // //街区
|
|
|
|
+ // Column(
|
|
|
|
+ // crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
+ // children: [
|
|
|
|
+ // MyTextView(
|
|
|
|
+ // S.current.block,
|
|
|
|
+ // marginBottom: 9,
|
|
|
|
+ // textColor: context.appColors.textBlack,
|
|
|
|
+ // fontSize: 16,
|
|
|
|
+ // isFontMedium: true,
|
|
|
|
+ // ),
|
|
|
|
+ //
|
|
|
|
+ // // 表单 - 街区
|
|
|
|
+ // _buildInputLayout(
|
|
|
|
+ // context,
|
|
|
|
+ // state,
|
|
|
|
+ // "block",
|
|
|
|
+ // textInputType: TextInputType.text,
|
|
|
|
+ // textInputAction: TextInputAction.next,
|
|
|
|
+ // onSubmit: (formKey, value) {
|
|
|
|
+ // state.formData[formKey]!['focusNode'].unfocus();
|
|
|
|
+ // FocusScope.of(context).requestFocus(state.formData['unit']!['focusNode']);
|
|
|
|
+ // },
|
|
|
|
+ // ).constrained(width: 88),
|
|
|
|
+ // ],
|
|
|
|
+ // ),
|
|
|
|
+ //
|
|
|
|
+ // MyTextView(
|
|
|
|
+ // "#",
|
|
|
|
+ // marginTop: 20,
|
|
|
|
+ // marginLeft: 8.5,
|
|
|
|
+ // marginRight: 8.5,
|
|
|
|
+ // textColor: context.appColors.textBlack,
|
|
|
|
+ // fontSize: 16,
|
|
|
|
+ // isFontMedium: true,
|
|
|
|
+ // ),
|
|
|
|
+ //
|
|
|
|
+ // //单元
|
|
|
|
+ // Column(
|
|
|
|
+ // crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
+ // children: [
|
|
|
|
+ // MyTextView(
|
|
|
|
+ // S.current.unit_number,
|
|
|
|
+ // marginBottom: 9,
|
|
|
|
+ // textColor: context.appColors.textBlack,
|
|
|
|
+ // fontSize: 16,
|
|
|
|
+ // isFontMedium: true,
|
|
|
|
+ // ),
|
|
|
|
+ // Row(
|
|
|
|
+ // children: [
|
|
|
|
+ // // 表单 - 单元
|
|
|
|
+ // _buildInputLayout(
|
|
|
|
+ // context,
|
|
|
|
+ // state,
|
|
|
|
+ // "unit",
|
|
|
|
+ // textInputAction: TextInputAction.next,
|
|
|
|
+ // onSubmit: (formKey, value) {
|
|
|
|
+ // state.formData[formKey]!['focusNode'].unfocus();
|
|
|
|
+ // FocusScope.of(context).requestFocus(state.formData['room']!['focusNode']);
|
|
|
|
+ // },
|
|
|
|
+ // ).constrained(width: 83),
|
|
|
|
+ //
|
|
|
|
+ // MyTextView(
|
|
|
|
+ // "-",
|
|
|
|
+ // textColor: context.appColors.textBlack,
|
|
|
|
+ // marginLeft: 4,
|
|
|
|
+ // marginRight: 4,
|
|
|
|
+ // isFontMedium: true,
|
|
|
|
+ // ),
|
|
|
|
+ //
|
|
|
|
+ // // 表单 - 房号
|
|
|
|
+ // _buildInputLayout(
|
|
|
|
+ // context,
|
|
|
|
+ // state,
|
|
|
|
+ // "room",
|
|
|
|
+ // textInputAction: TextInputAction.done,
|
|
|
|
+ // onSubmit: (formKey, value) {
|
|
|
|
+ // state.formData[formKey]!['focusNode'].unfocus();
|
|
|
|
+ // },
|
|
|
|
+ // ).constrained(width: 83),
|
|
|
|
+ // ],
|
|
|
|
+ // ),
|
|
|
|
+ // ],
|
|
|
|
+ // ),
|
|
|
|
+ // ],
|
|
|
|
+ // ),
|
|
|
|
|
|
|
|
+ //选择
|
|
|
|
+ Column(
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
+ children: [
|
|
MyTextView(
|
|
MyTextView(
|
|
- "#",
|
|
|
|
- marginTop: 20,
|
|
|
|
- marginLeft: 8.5,
|
|
|
|
- marginRight: 8.5,
|
|
|
|
|
|
+ S.current.unit_number,
|
|
|
|
+ marginBottom: 9,
|
|
|
|
+ marginLeft: 17,
|
|
textColor: context.appColors.textBlack,
|
|
textColor: context.appColors.textBlack,
|
|
fontSize: 16,
|
|
fontSize: 16,
|
|
isFontMedium: true,
|
|
isFontMedium: true,
|
|
),
|
|
),
|
|
|
|
|
|
- //单元
|
|
|
|
- Column(
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
- children: [
|
|
|
|
- MyTextView(
|
|
|
|
- S.current.unit_number,
|
|
|
|
- marginBottom: 9,
|
|
|
|
- textColor: context.appColors.textBlack,
|
|
|
|
- fontSize: 16,
|
|
|
|
- isFontMedium: true,
|
|
|
|
- ),
|
|
|
|
- Row(
|
|
|
|
- children: [
|
|
|
|
- // 表单 - 单元
|
|
|
|
- _buildInputLayout(
|
|
|
|
- context,
|
|
|
|
- state,
|
|
|
|
- "unit",
|
|
|
|
- textInputAction: TextInputAction.next,
|
|
|
|
- onSubmit: (formKey, value) {
|
|
|
|
- state.formData[formKey]!['focusNode'].unfocus();
|
|
|
|
- FocusScope.of(context).requestFocus(state.formData['room']!['focusNode']);
|
|
|
|
- },
|
|
|
|
- ).constrained(width: 83),
|
|
|
|
-
|
|
|
|
- MyTextView(
|
|
|
|
- "-",
|
|
|
|
- textColor: context.appColors.textBlack,
|
|
|
|
- marginLeft: 4,
|
|
|
|
- marginRight: 4,
|
|
|
|
- isFontMedium: true,
|
|
|
|
- ),
|
|
|
|
|
|
+ PickerContainer(
|
|
|
|
+ hint: 'Please Select',
|
|
|
|
+ enable: true,
|
|
|
|
+ content: state.selectedUnitName ?? "",
|
|
|
|
+ onClick: (context) {
|
|
|
|
+ viewModel.pickUnit(context);
|
|
|
|
+ },
|
|
|
|
+ ).marginOnly(left: 17, right: 17),
|
|
|
|
|
|
- // 表单 - 房号
|
|
|
|
- _buildInputLayout(
|
|
|
|
- context,
|
|
|
|
- state,
|
|
|
|
- "room",
|
|
|
|
- textInputAction: TextInputAction.done,
|
|
|
|
- onSubmit: (formKey, value) {
|
|
|
|
- state.formData[formKey]!['focusNode'].unfocus();
|
|
|
|
- },
|
|
|
|
- ).constrained(width: 83),
|
|
|
|
- ],
|
|
|
|
- ),
|
|
|
|
- ],
|
|
|
|
- ),
|
|
|
|
],
|
|
],
|
|
),
|
|
),
|
|
|
|
|
|
@@ -199,52 +222,52 @@ class SelectUnitPage extends HookConsumerWidget {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- /// 输入框
|
|
|
|
- Widget _buildInputLayout(
|
|
|
|
- BuildContext context,
|
|
|
|
- SelectUnitState state,
|
|
|
|
- String key, {
|
|
|
|
- double marginTop = 0,
|
|
|
|
- bool? showRightIcon = false, //是否展示右侧的布局
|
|
|
|
- Widget? rightWidget, //右侧的布局
|
|
|
|
- TextInputType textInputType = TextInputType.number,
|
|
|
|
- String? errorText,
|
|
|
|
- bool obscureText = false,
|
|
|
|
- TextInputAction textInputAction = TextInputAction.done,
|
|
|
|
- Function? onSubmit,
|
|
|
|
- }) {
|
|
|
|
- return IgnoreKeyboardDismiss(
|
|
|
|
- child: MyTextField(
|
|
|
|
- key,
|
|
|
|
- fillBackgroundColor: context.appColors.authFiledBG,
|
|
|
|
- state.formData[key]!['value'],
|
|
|
|
- hintText: state.formData[key]!['hintText'],
|
|
|
|
- hintStyle: TextStyle(
|
|
|
|
- color: context.appColors.authFiledHint,
|
|
|
|
- fontSize: 16.0,
|
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
|
- ),
|
|
|
|
- controller: state.formData[key]!['controller'],
|
|
|
|
- focusNode: state.formData[key]!['focusNode'],
|
|
|
|
- margin: EdgeInsets.only(top: marginTop),
|
|
|
|
- padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
|
|
|
|
- showDivider: false,
|
|
|
|
- height: 44,
|
|
|
|
- style: TextStyle(
|
|
|
|
- color: context.appColors.authFiledText,
|
|
|
|
- fontSize: 16.0,
|
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
|
- ),
|
|
|
|
- inputType: textInputType,
|
|
|
|
- textInputAction: textInputAction,
|
|
|
|
- onSubmit: onSubmit,
|
|
|
|
- cursorColor: context.appColors.authFiledText,
|
|
|
|
- obscureText: obscureText,
|
|
|
|
- errorText: errorText,
|
|
|
|
- showLeftIcon: true,
|
|
|
|
- showRightIcon: showRightIcon,
|
|
|
|
- rightWidget: rightWidget,
|
|
|
|
- ),
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
|
|
+ // /// 输入框
|
|
|
|
+ // Widget _buildInputLayout(
|
|
|
|
+ // BuildContext context,
|
|
|
|
+ // SelectUnitState state,
|
|
|
|
+ // String key, {
|
|
|
|
+ // double marginTop = 0,
|
|
|
|
+ // bool? showRightIcon = false, //是否展示右侧的布局
|
|
|
|
+ // Widget? rightWidget, //右侧的布局
|
|
|
|
+ // TextInputType textInputType = TextInputType.number,
|
|
|
|
+ // String? errorText,
|
|
|
|
+ // bool obscureText = false,
|
|
|
|
+ // TextInputAction textInputAction = TextInputAction.done,
|
|
|
|
+ // Function? onSubmit,
|
|
|
|
+ // }) {
|
|
|
|
+ // return IgnoreKeyboardDismiss(
|
|
|
|
+ // child: MyTextField(
|
|
|
|
+ // key,
|
|
|
|
+ // fillBackgroundColor: context.appColors.authFiledBG,
|
|
|
|
+ // state.formData[key]!['value'],
|
|
|
|
+ // hintText: state.formData[key]!['hintText'],
|
|
|
|
+ // hintStyle: TextStyle(
|
|
|
|
+ // color: context.appColors.authFiledHint,
|
|
|
|
+ // fontSize: 16.0,
|
|
|
|
+ // fontWeight: FontWeight.w500,
|
|
|
|
+ // ),
|
|
|
|
+ // controller: state.formData[key]!['controller'],
|
|
|
|
+ // focusNode: state.formData[key]!['focusNode'],
|
|
|
|
+ // margin: EdgeInsets.only(top: marginTop),
|
|
|
|
+ // padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
|
|
|
|
+ // showDivider: false,
|
|
|
|
+ // height: 44,
|
|
|
|
+ // style: TextStyle(
|
|
|
|
+ // color: context.appColors.authFiledText,
|
|
|
|
+ // fontSize: 16.0,
|
|
|
|
+ // fontWeight: FontWeight.w500,
|
|
|
|
+ // ),
|
|
|
|
+ // inputType: textInputType,
|
|
|
|
+ // textInputAction: textInputAction,
|
|
|
|
+ // onSubmit: onSubmit,
|
|
|
|
+ // cursorColor: context.appColors.authFiledText,
|
|
|
|
+ // obscureText: obscureText,
|
|
|
|
+ // errorText: errorText,
|
|
|
|
+ // showLeftIcon: true,
|
|
|
|
+ // showRightIcon: showRightIcon,
|
|
|
|
+ // rightWidget: rightWidget,
|
|
|
|
+ // ),
|
|
|
|
+ // );
|
|
|
|
+ // }
|
|
}
|
|
}
|