|
@@ -34,12 +34,14 @@ class GaragesalePostPage extends HookConsumerWidget {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
- final vm = ref.read(garagesalePostVmProvider.notifier);
|
|
|
+ final vm = ref.watch(garagesalePostVmProvider.notifier);
|
|
|
+ final state = ref.watch(garagesalePostVmProvider);
|
|
|
+
|
|
|
|
|
|
return Scaffold(
|
|
|
appBar: MyAppBar.appBar(
|
|
|
context,
|
|
|
- "Garagesale Post",
|
|
|
+ "Post New Item",
|
|
|
backgroundColor: context.appColors.whiteBG,
|
|
|
),
|
|
|
backgroundColor: Colors.white,
|
|
@@ -64,7 +66,7 @@ class GaragesalePostPage extends HookConsumerWidget {
|
|
|
),
|
|
|
|
|
|
Container(
|
|
|
- margin: const EdgeInsets.only(left:15, right:15, top: 20),
|
|
|
+ margin: const EdgeInsets.only(left:15, right:15, top: 15),
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
@@ -73,13 +75,26 @@ class GaragesalePostPage extends HookConsumerWidget {
|
|
|
textColor: context.appColors.textBlack,
|
|
|
fontSize: 17,
|
|
|
).marginOnly(bottom: 14.5),
|
|
|
- _buildInputLayout(context, ref, 'title'),
|
|
|
+ _buildInputLayout(
|
|
|
+ context,
|
|
|
+ ref,
|
|
|
+ state,
|
|
|
+ 'title',
|
|
|
+ marginTop: 16,
|
|
|
+ textInputType: TextInputType.text,
|
|
|
+ textInputAction: TextInputAction.next,
|
|
|
+ errorText: state.titleErrorText,
|
|
|
+ onSubmit: (formKey, value) {
|
|
|
+ state!.formData[formKey]!['focusNode'].unfocus();
|
|
|
+ FocusScope.of(context).requestFocus(state.formData['description']!['focusNode']);
|
|
|
+ },
|
|
|
+ ),
|
|
|
]
|
|
|
)
|
|
|
),
|
|
|
|
|
|
Container(
|
|
|
- margin: const EdgeInsets.only(left:15, right:15,top: 20),
|
|
|
+ margin: const EdgeInsets.only(left:15, right:15,top: 15),
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
@@ -88,7 +103,7 @@ class GaragesalePostPage extends HookConsumerWidget {
|
|
|
textColor: context.appColors.textBlack,
|
|
|
fontSize: 17,
|
|
|
).marginOnly(bottom: 14.5),
|
|
|
- _buildTextArea(context, ref, 'description'),
|
|
|
+ _buildTextArea(context, ref, 'description',),
|
|
|
]
|
|
|
)
|
|
|
|
|
@@ -97,7 +112,7 @@ class GaragesalePostPage extends HookConsumerWidget {
|
|
|
width: double.infinity,
|
|
|
height: 200,
|
|
|
color: Colors.white,
|
|
|
- margin: const EdgeInsets.only(left:15, right:15, top: 10, bottom: 20),
|
|
|
+ margin: const EdgeInsets.only(left:15, right:15, top: 15, bottom: 20),
|
|
|
|
|
|
child: _buildImageSelectCmp(context, ref,vm),
|
|
|
),
|
|
@@ -144,14 +159,6 @@ class GaragesalePostPage extends HookConsumerWidget {
|
|
|
decoration: BoxDecoration(
|
|
|
color: context.appColors.authFiledBG,
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
),
|
|
|
child: _buildTextAreaLayout(
|
|
|
context,
|
|
@@ -260,20 +267,20 @@ class GaragesalePostPage extends HookConsumerWidget {
|
|
|
Widget _buildInputLayout(
|
|
|
BuildContext context,
|
|
|
WidgetRef ref,
|
|
|
+ state,
|
|
|
String key,
|
|
|
{
|
|
|
- double height = 48,
|
|
|
- double maxLines = 1,
|
|
|
double marginTop = 0,
|
|
|
bool? showRightIcon = false,
|
|
|
Widget? rightWidget,
|
|
|
TextInputType textInputType = TextInputType.text,
|
|
|
String? errorText,
|
|
|
bool obscureText = false,
|
|
|
+ bool enable = true,
|
|
|
TextInputAction textInputAction = TextInputAction.done,
|
|
|
Function? onSubmit,
|
|
|
}) {
|
|
|
- final state = ref.watch(garagesalePostVmProvider);
|
|
|
+
|
|
|
return IgnoreKeyboardDismiss(
|
|
|
child: MyTextField(
|
|
|
key,
|
|
@@ -290,7 +297,6 @@ class GaragesalePostPage extends HookConsumerWidget {
|
|
|
margin: EdgeInsets.only(top: marginTop),
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
|
|
|
showDivider: false,
|
|
|
- height: height,
|
|
|
style: TextStyle(
|
|
|
color: context.appColors.authFiledText,
|
|
|
fontSize: 16.0,
|