We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2771019 + 8ad740f commit 0262e24Copy full SHA for 0262e24
lib/src/form_builder.dart
@@ -214,8 +214,12 @@ class FormBuilderState extends State<FormBuilder> {
214
_fields[name] = field;
215
field.registerTransformer(_transformers);
216
217
+ if (widget.clearValueOnUnregister || (_instantValue[name] == null)) {
218
+ _instantValue[name] = field.initialValue ?? initialValue[name];
219
+ }
220
+
221
field.setValue(
- oldField?.value ?? (_instantValue[name] ??= field.initialValue),
222
+ _instantValue[name],
223
populateForm: false,
224
);
225
}
0 commit comments