FormController class

A controller for a form.

Inheritance
Mixed in types

Constructors

FormController({Set<InputFieldValidator> validators = const {}, String? debugLabel})
Creates an instance of FormController.

Properties

activeTags Set<Object>
All the field tags active in the form.
no setterinherited
debugLabel String?
A debug label that is used for diagnostic output.
getter/setter pairinherited
errors Map<Object, InputFieldError>
The current errors of this form.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isSubmitted bool
Returns true if the form has been submitted.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
states Set<InputFormState>
The current states of this form.
no setterinherited
tags Set<Object>
All the field tags bound to this form.
no setterinherited
values Map<Object, Object?>
The current values of this form.
no setterinherited

Methods

activate(Object tag) → void
Sets the field bound with the tag as active.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
call<T extends Object>(Object tag) FieldController<T>
Gets the FieldController bound with the tag.
contains(Set<InputFormState> states) bool
Returns true if the form states contains any of the states.
deactivate(Object tag) → void
Sets the field bound with the tag as inactive.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
getField<T extends Object>(Object tag) FieldController<T>?
Gets the FieldController bound with the tag.
getValue<T extends Object>(Object tag) → T?
Gets the value of the field bound with the tag.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
remove(Object tag) → void
Removes the field bound with the tag.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
Resets the form to initial state.
setInitialValues(Map<Object, Object?> initialValues, {bool notify = true}) → void
Sets the initial values for the form.
setSubmitted(bool isSubmitted) → void
Sets the value for isSubmitted of the form and each field.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
override
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({Set<Object>? tags, bool notify = true}) bool
Validates the form.

Operators

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