FormFieldState<T> class abstract

Abstract state management class for FormField elements.

Manages the validation errors, lifecycle context hooks, and registration of a FormField with its parent Form. It hooks into didChangeDependencies and dispose to coordinate dynamic inherited widget bindings with FormScope.

Inheritance

Constructors

FormFieldState()

Properties

context BuildContext
The location in the tree where this widget builds.
no setterinherited
errorText String?
Retrieves the validation error message if invalid; otherwise, null.
no setter
hasError bool
Returns whether this field currently holds an active validation error.
no setter
hashCode int
The hash code for this object.
no setterinherited
mounted bool
Whether this State object is currently in a tree.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T?
Retrieves the current value of the form field.
no setter
widget FormField<T>
The current configuration.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
inherited
didChangeDependencies() → void
Called when a dependency of this State object changes.
override
dispose() → void
Called when this object is removed from the tree permanently.
override
initState() → void
Called when this object is inserted into the tree.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets the form field to its FormField.initialValue and clears any active errors.
setState(VoidCallback fn) → void
Notifies the framework that the internal state of this object has changed.
inherited
toString() String
A string representation of this object.
inherited
validate() bool
Triggers field validation using FormField.validator.

Operators

operator ==(Object other) bool
The equality operator.
inherited