Skip to content

Commit db10a1a

Browse files
Change value property to fix #725 & #681 (#854)
According to documentation `initialValue` of any field can be null.
1 parent ee15f93 commit db10a1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/fields/form_builder_switch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class FormBuilderSwitch extends FormBuilderField<bool> {
132132
isThreeLine: false,
133133
contentPadding: contentPadding,
134134
title: title,
135-
value: state.value!,
135+
value: state.value ?? false,
136136
onChanged: state.enabled
137137
? (val) {
138138
state.requestFocus();

0 commit comments

Comments
 (0)