form_bloc icon indicating copy to clipboard operation
form_bloc copied to clipboard

Validator on ListFieldBloc

Open andreag85 opened this issue 4 years ago • 1 comments

I have this bloc ListFieldBloc<InputFieldBloc<File, Object>> for selecting image files. Is it possible to add a validator for ListFieldBloc? I need to require that at least n images are inserted for a form, how can I do this?

andreag85 avatar Aug 04 '20 13:08 andreag85

Hi @andreag85, validator is not available, but for your case, you can use a BlocBuilder with the list field Bloc, and check the length of the fieldBlocs

GiancarloCode avatar Aug 04 '20 16:08 GiancarloCode