Skip to content

Commit 8308ecc

Browse files
committed
In FormBuilder.setAttributeValue use didChange() instead of setting attribute value manually
1 parent 572c1a3 commit 8308ecc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/src/form_builder.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FormBuilderState extends State<FormBuilder> {
3636

3737
Map<String, dynamic> _value;
3838

39-
Map<String, dynamic> get value => {...widget.initialValue ?? {}, ..._value};
39+
Map<String, dynamic> get value => {...(widget.initialValue ?? {}), ..._value};
4040

4141
Map<String, dynamic> get initialValue => widget.initialValue;
4242

@@ -58,9 +58,7 @@ class FormBuilderState extends State<FormBuilder> {
5858
}
5959

6060
void setAttributeValue(String attribute, dynamic value) {
61-
setState(() {
62-
_value[attribute] = value;
63-
});
61+
_fieldKeys[attribute]?.currentState?.didChange(value);
6462
}
6563

6664
registerFieldKey(String attribute, GlobalKey key) {

0 commit comments

Comments
 (0)