FormFieldsController<F extends FormSchema> class
A controller that manages form field states and validation
- Inheritance
-
- Object
- ChangeNotifier
- FormFieldsController
Constructors
- FormFieldsController.new(FormKey key, F formSchema)
- Creates a FormFieldsController.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- key → FormKey
-
The form key.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
fieldKey<
T> (TypedId< T> fieldId) → GlobalKey<FormFieldState< T> > - Get or create a GlobalKey for a form field
-
getFieldError<
T> (TypedId< T> fieldId) → String? - Get the error of a form field.
-
getValue<
T> (TypedId< T> fieldId) → T? - Get the value of a form field.
-
getValues(
) → Map< String, dynamic> - Get the values of the form fields.
-
hasFieldError<
T> (TypedId< T> fieldId) → bool - Check if a form field has an error.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
save(
) → void - Save the form.
-
setError<
T> (TypedId< T> fieldId, String error) → void - Set the error of a form field.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateValue<
T> (TypedId< T> fieldId, T? value) → T? - Update the value of a form field.
-
validate(
) → bool - Validate the form.
-
validators<
T> (TypedId< T> fieldId) → ValidatorFn<T> ? -
Get the validators of a form field. Use
localize
to localize the validators.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited