Skip to content

Commit e53778d

Browse files
committed
Fixed bug Validation not working for fields outside screen
1 parent f21d843 commit e53778d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/src/form_builder.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ class _FormBuilderState extends State<FormBuilder> {
4848
//TODO: Allow user to update field value or validate based on changes in others (e.g. Summations, Confirm Password)
4949
onWillPop: widget.onWillPop,
5050
autovalidate: widget.autovalidate,
51-
child: ListView(
52-
children: formControlsToForm(),
51+
child: SingleChildScrollView(
52+
child: Column(
53+
children: formControlsToForm(),
54+
),
5355
),
5456
);
5557
}
@@ -89,14 +91,13 @@ class _FormBuilderState extends State<FormBuilder> {
8991
keyboardType = TextInputType.text;
9092
break;
9193
}
92-
9394
formControlsList.add(TextFormField(
9495
decoration: InputDecoration(
9596
labelText: formControl.label,
9697
hintText: formControl.hint,
9798
helperText: formControl.hint,
9899
),
99-
initialValue: "${formControl.value}" ?? null,
100+
initialValue: formControl.value != null ? "${formControl.value}" : '',
100101
maxLines: formControl.type == FormBuilderInput.TYPE_MULTILINE_TEXT
101102
? 5
102103
: 1,

0 commit comments

Comments
 (0)