flutter_hook_form library

Classes

CrossFieldValidator<T>
A validator that validates a cross field.
DateAfterValidator
Compare the value with the value of the cross field and validate if the value is after the cross field value.
EmailValidator
Email validator.
FieldSchema<T>
This is a contract for a field schema. It is used to define the schema of a form field. Implement this interface to define the schema of a form field.
FieldValidator<T>
A validator that validates a single field.
FormErrorMessages
A class that contains the default form error messages.
FormFieldsController<F extends FieldSchema>
A controller that manages form field states and validation
HookedForm<F extends FieldSchema>
A form that integrates with flutter_hook_form.
HookedFormField<T, F extends FieldSchema<T>>
A form field that integrates with flutter_hook_form.
HookedFormProvider<F extends FieldSchema>
Provides a FormFieldsController to descendant widgets.
HookedTextFormField<F extends FieldSchema<String>>
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>
Compare the value with the value of the cross field and validate if the value matches the cross field value.
MaxLengthValidator
Maximum length validator.
MimeTypeValidator
Mime type validator.
MinLengthValidator
Minimum length validator.
PatternValidator
Pattern validator.
PhoneValidator
Phone validator.
RequiredValidator<T>
Required field validator.
Validator<T>
Base class for all validators.

Extensions

FieldSchemaExtension on FieldSchema<T>
Extension methods for FieldSchema.
FormListenExtension on FormFieldsController<F>
Extension on FormFieldsController providing reactive field listening.
LocalizeError on String?
Localize error extension.
MessageResolver on List<Validator>?
Validator list extension.

Functions

useFieldValue<F extends FieldSchema, T>(FormFieldsController<F> form, F field) → T?
A hook that listens to a specific field's value changes.
useForm<F extends FieldSchema>({InitialFieldValues<F, dynamic>? initialValues, List<Object?> keys = const <Object>[]}) FormFieldsController<F>
A hook that provides a FormFieldsController to manage form field states.
useFormContext(BuildContext context) FormFieldsController<FieldSchema>
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<F extends FieldSchema, T> = Map<F, T>
A type that represents the initial values of a form field.