Closed KouloukLeGrand closed 2 years ago
Same here.
FormBuilderFilePicker(
name: 'pdf_file',
maxFiles: 1,
type: FileType.custom,
allowedExtensions: const ['pdf'],
decoration: const InputDecoration(
labelText: 'PDF File *',
),
validator: FormBuilderValidators.required(context),
),
Validation fails but border doesn't change nor does the error message show.
I managed to get it working by using the:
decoration: InputDecoration(
labelText: 'PDF File *',
errorText: errorText,
),
method.
This may solve the issue for you. However it's not ideal when working with dynamic forms like I am at all...
Any plans fixing this? :confused:
Hi,
When calling
_formKey.currentState!.fields["filePicker"]!.invalidate("Validation error");
(assuming_formKey
is aGlobalKey<FormBuilderState>
and the filePicker field is aFormBuilderFilePicker
) or otherwise using thevalidator:
property ofFormBuilderFilePicker
, no error message appears on the field.Do I have to tinker my own solution or am I missing something?