Skip to content

Commit

Permalink
Image Picker fix (#610)
Browse files Browse the repository at this point in the history
* Added a null-safe spread operator for field.value to guard against a null value. Resolves #607.
  • Loading branch information
awhitford authored Dec 2, 2020
1 parent d4f862d commit 1966c19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/fields/form_builder_image_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ class FormBuilderImagePicker extends FormBuilderField<List<dynamic>> {
onImageSelected: (image) {
state.requestFocus();
field.didChange(
<dynamic>[...field.value, image]);
<dynamic>[...?field.value, image]);
Navigator.pop(state.context);
},
onImage: (image) {
field.didChange(
<dynamic>[...field.value, image]);
<dynamic>[...?field.value, image]);
onChanged?.call(field.value);
Navigator.pop(state.context);
},
Expand Down

0 comments on commit 1966c19

Please sign in to comment.