Skip to content

Commit 1c207e7

Browse files
committed
feat: expose state in ImagePicker previewBuilder
Enables custom previewBuilder implementations to access validation state and error messages. This makes it possible to display validation errors with custom preview layouts, which wasn't previously possible. Signed-off-by: Ricardo <[email protected]>
1 parent 505f191 commit 1c207e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/src/form_builder_image_picker.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class FormBuilderImagePicker extends FormBuilderFieldDecoration<List<dynamic>> {
4242
BuildContext,
4343
List<Widget> children,
4444
Widget? addButton,
45+
FormBuilderImagePickerState state,
4546
)? previewBuilder;
4647

4748
/// placeholder image displayed when picking a new image
@@ -332,6 +333,7 @@ class FormBuilderImagePicker extends FormBuilderFieldDecoration<List<dynamic>> {
332333
context,
333334
widgets,
334335
canUpload ? addButtonBuilder(context) : null,
336+
state,
335337
);
336338
});
337339
}

0 commit comments

Comments
 (0)