DraftModeFormState class

Concrete FormState implementation with draft tracking and per-attribute validation orchestration.

Inheritance
Implemented types

Constructors

DraftModeFormState()

Properties

context BuildContext
The location in the tree where this widget builds.
no setterinherited
controller DraftModeFormController
final
enableValidation bool
no setter
fields Iterable<FormFieldState>
The FormFieldState objects that are currently registered with this Form.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isDirty bool
no setter
mounted bool
Whether this State object is currently in a tree.
no setterinherited
onSubmit bool
no setter
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
attribute<T>(DraftModeFieldDefinition<T> definition) DraftModeFormAttribute<T>
override
beginAttributeValidation(dynamic attribute) → void
Marks the start of validation for a concrete attribute.
override
build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
inherited
clearError() → void
Clears the validation errors for all FormFields in this Form without resetting their values.
inherited
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
endAttributeValidation(dynamic attribute) → void
Marks the end of validation for a concrete attribute.
override
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
read<V>(dynamic attribute) → V?
Returns the current value for a related attribute, if available.
override
reassemble() → void
Called whenever the application is reassembled during debugging, for example during hot reload.
inherited
registerAttribute<T>(DraftModeFormAttribute<T> attribute) → void
override
registerDependency(dynamic dependency) → void
Records that the current validation depends on dependency.
override
registerField<T>(DraftModeFormAttribute<T> attribute, GlobalKey<FormFieldState<T>> key) → void
override
replaceAttribute<T>(DraftModeFormAttribute<T> attribute, T? value) → void
override
replaceValue<T>(DraftModeFieldDefinition<T> definition, T? value) → void
override
reset() → void
Resets every FormField that is a descendant of this Form back to its FormField.initialValue.
override
save() → void
Saves every FormField that is a descendant of this Form.
override
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
unregisterField<T>(DraftModeFormAttribute<T> attribute, GlobalKey<FormFieldState<T>> key) → void
override
updateAttribute<T>(DraftModeFormAttribute<T> attribute, T? value) → void
override
updateValue<T>(DraftModeFieldDefinition<T> definition, T? value) → void
override
validate() bool
Validates every FormField that is a descendant of this Form, and returns true if there are no errors.
override
validateAttribute<T>(DraftModeFormAttribute<T> attribute) → void
override
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.
inherited
value<T>(DraftModeFieldDefinition<T> definition) → T?
override

Operators

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

Static Methods

of(BuildContext context) DraftModeFormState?