FormState class
State associated with a Form widget.
A FormState object can be used to save, reset, and validate every FormField that is a descendant of the associated Form.
Typically obtained via Form.of.
Constructors
Properties
- context â BuildContext
-
The location in the tree where this widget builds.
no setterinherited
- 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
- widget â Form
-
The current configuration.
no setterinherited
Methods
-
activate(
) â void -
Called when this object is reinserted into the tree after having been
removed via deactivate.
inherited
-
build(
BuildContext context) â Widget -
Describes the part of the user interface represented by this widget.
override
-
deactivate(
) â void -
Called when this object is removed from the tree.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) â void -
Add additional properties associated with the node.
inherited
-
didChangeDependencies(
) â void -
Called when a dependency of this State object changes.
inherited
-
didUpdateWidget(
covariant Form oldWidget) â void -
Called whenever the widget configuration changes.
inherited
-
dispose(
) â void -
Called when this object is removed from the tree permanently.
inherited
-
initState(
) â void -
Called when this object is inserted into the tree.
inherited
-
noSuchMethod(
Invocation invocation) â dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reassemble(
) â void -
Called whenever the application is reassembled during debugging, for
example during hot reload.
inherited
-
reset(
) â void - Resets every FormField that is a descendant of this Form back to its FormField.initialValue.
-
save(
) â void - Saves every FormField that is a descendant of this Form.
-
setState(
VoidCallback fn) â void -
Notify the framework that the internal state of this object has changed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) â DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) â String -
A string representation of this object.
inherited
-
toStringShort(
) â String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
-
validate(
) â bool - Validates every FormField that is a descendant of this Form, and returns true if there are no errors.
-
validateGranularly(
) â Set< FormFieldState< Object?> > - Validates every FormField that is a descendant of this Form, and returns a Set of FormFieldState of the invalid field(s) only, if any.
Operators
-
operator ==(
Object other) â bool -
The equality operator.
inherited