FieldController<T extends Object> class

A controller for a single field in a FormController.

See also:

Inheritance
Mixed in types
Implementers

Constructors

FieldController.create(FormController parent, {required Object tag, bool autoValidate = false})
Creates an instance of FieldController if not attached to the parent.
factory

Properties

autoValidate bool
Whether this field should be automatically validated.
finalinherited
error InputFieldError
The current error of this field.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isDirty bool
Returns true if the field has been modified.
no setterinherited
isSubmitted bool
Returns true if the field has been submitted with setSubmitted.
no setterinherited
parent FormController
The parent FormController of this field.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tag Object
The tag of this field.
finalinherited
value → T?
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
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).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onChanged(T? value, {bool notify = true}) → void
Sets the value of the field.
onUpdate(void listener(T? value)) → void
Callback for listening to changes in the field.
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 field to its initial value.
inherited
setError(InputFieldError error, {bool notify = true}) → void
Sets the error of the field.
setInitialValue(T? value, {bool notify = false}) → void
Sets the initial value of the field.
setSubmitted(bool value) → void
Sets the value for isSubmitted of the field.
setValidators(Set<InputFieldValidator> validators) → void
Sets the validators for the field.
setValue(T? value, {bool notify = true}) → void
Sets the value of the 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({bool notify = true}) bool
Validates the field.

Operators

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