Skip to content

Commit e5a321e

Browse files
committed
Set initialValue for CheckboxList to empty list if it’s set to null
1 parent 2aa217d commit e5a321e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/fields/form_builder_checkbox_list.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class _FormBuilderCheckboxListState extends State<FormBuilderCheckboxList> {
8282
return FormField(
8383
key: _fieldKey,
8484
enabled: !_readonly,
85-
initialValue: widget.initialValue,
85+
initialValue: widget.initialValue ?? [],
8686
validator: (val) {
8787
for (int i = 0; i < widget.validators.length; i++) {
8888
if (widget.validators[i](val) != null)

0 commit comments

Comments
 (0)