FormFieldState<T> class

The mutable state for a FormField, tracking value and validation errors.

Inheritance

Constructors

FormFieldState()

Properties

context BuildContext
The BuildContext for this state object.
no setterinherited
errorText String?
The current validation error message, or null if valid.
no setter
hasError bool
Whether the field currently has a validation error.
no setter
hashCode int
The hash code for this object.
no setterinherited
isValid bool
Whether the field currently passes validation.
no setter
mounted bool
Whether this state object is currently in the tree.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The current value of the field.
no setter
widget FormField<T>
The current widget configuration.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this state.
override
didUpdateWidget(FormField<T> oldWidget) → void
Called when the widget configuration changes.
inherited
dispose() → void
Called when this state object is removed from the tree permanently.
override
initState() → void
Called when this state object is first inserted into the tree.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets the field to initialValue and clears any error.
save() → void
Calls onSaved with the current value.
setState(void fn()) → void
Notifies the framework that the internal state has changed, triggering a rebuild.
inherited
setValue(T value) → void
Updates the field value and triggers a rebuild.
toString() String
A string representation of this object.
inherited
validate() bool
Runs the validator and returns true if the field is valid.

Operators

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