flutter_hook_form library

Classes

CrossFieldValidator<T, E extends Enum>
A validator that validates a cross field.
DateAfterValidator<E extends Enum>
Compare the value with the value of the cross field and validate if the value is after the cross field value.
EmailValidator
Email validator.
FieldConfig<T>
FieldValidator<T>
A validator that validates a single field.
FormErrorMessages
A class that contains the default form error messages.
FormFieldsController<E extends Enum>
A controller that manages form field states and validation
HookedForm<E extends Enum>
A form that integrates with flutter_hook_form.
HookedFormField<T, E extends Enum>
A form field that integrates with flutter_hook_form.
HookedFormProvider<E extends Enum>
Provides a FormFieldsController to descendant widgets.
HookedTextFormField<E extends Enum>
A text form field that integrates with flutter_hook_form.
HookFormScope
Add this widget on top of your widget tree to override the default form messages. Useful to translate the form error messages.
IsAfterValidator
Date after validator.
IsBeforeValidator
Date before validator.
ListMaxItemsValidator<T>
Maximum items validator.
ListMinItemsValidator<T>
Minimum items validator.
MatchesValidator<T, E extends Enum>
Compare the value with the value of the cross field and validate if the value matches the cross field value.
MaxLengthValidator
Maximum length validator.
MaxValidator<T extends num>
Maximum validator.
MimeTypeValidator
Mime type validator.
MinLengthValidator
Minimum length validator.
MinValidator<T extends num>
Minimum validator.
OptionalValidator<T>
Optional field validator.
PatternValidator
Pattern validator.
PhoneValidator
Phone validator.
RangeValidator<T extends num>
RequiredValidator<T>
Required field validator.
Validator<T>
Base class for all validators.

Functions

useForm<E extends Enum>({Map<E, FieldConfig> validators = const {}, List<Object?> keys = const <Object>[], bool focusOnInvalid = false, bool autoScrollWhenFocusOnInvalid = true}) → FormFieldsController<E>
A hook that provides a FormFieldsController to manage form field states.
useFormContext<E extends Enum>(BuildContext context) → FormFieldsController<E>
A hook that provides access to the FormFieldsController from context.

Typedefs

CrossFieldValidatorFn<T> = String? Function(T? value, BuildContext context)
A type alias for a cross field validator function.
FieldValidatorFn<T> = String? Function(T? value)
A type alias for a validator function.
InitialFieldValues<E extends Enum, T> = Map<E, T>
A type that represents the initial values of a form field.