FormState class
The mutable state for a Form, managing field registration and validation.
Constructors
Properties
- context → BuildContext
-
The BuildContext for this state object.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isValid → bool
-
Whether all registered fields currently pass 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
- widget → Form
-
The current widget configuration.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this state.
override
-
didUpdateWidget(
Form oldWidget) → void -
Called when the widget configuration changes.
inherited
-
dispose(
) → void -
Called when this state object is removed from the tree permanently.
inherited
-
initState(
) → void -
Called when this state object is first inserted into the tree.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
FormFieldState field) → void - Registers a FormFieldState with this form.
-
reset(
) → void - Resets all fields to their initial values and clears errors.
-
save(
) → void - Calls FormField.onSaved on every registered field.
-
setState(
void fn()) → void -
Notifies the framework that the internal state has changed, triggering a rebuild.
inherited
-
submit(
) → void -
Validates all fields and calls
onSubmittedif all pass. -
toString(
) → String -
A string representation of this object.
inherited
-
unregister(
FormFieldState field) → void - Unregisters a FormFieldState from this form.
-
validate(
) → bool -
Validates all registered fields and returns
trueif all pass.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited