From 1c207e76b9f9e6d019fd64bcc8b97dc2838c14ef Mon Sep 17 00:00:00 2001 From: Ricardo Date: Mon, 24 Feb 2025 20:38:04 -0300 Subject: [PATCH] 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 --- lib/src/form_builder_image_picker.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/form_builder_image_picker.dart b/lib/src/form_builder_image_picker.dart index edd525c..450ee91 100644 --- a/lib/src/form_builder_image_picker.dart +++ b/lib/src/form_builder_image_picker.dart @@ -42,6 +42,7 @@ class FormBuilderImagePicker extends FormBuilderFieldDecoration> { BuildContext, List children, Widget? addButton, + FormBuilderImagePickerState state, )? previewBuilder; /// placeholder image displayed when picking a new image @@ -332,6 +333,7 @@ class FormBuilderImagePicker extends FormBuilderFieldDecoration> { context, widgets, canUpload ? addButtonBuilder(context) : null, + state, ); }); }