ValueListenableValidationConnector<K, I> class

Validation Connector, that subscribes on provided ValueListenable

Allows to invoke validation on value change or clear validation errors as soon as value is changes.

Requires to be attached to the controller.

As soon as it attaches to controller, it starts listen provided ValueListenable.

Inheritance
Implemented types

Constructors

ValueListenableValidationConnector({required K field, required ValueListenable<I> valueListenable, required Validator<I> validator, bool validateOnChange = false, bool clearOnChange = true, bool validateOnAttach = false})
Creates default connector

Properties

clearOnChange bool
Defines if error message should be removed when ValueListenable even is emitted.
final
controller ValidationController<K>?
Attached ValidationController controller
no setterinherited
field → K
Field key for error message
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validateOnAttach bool
If value should be validated on connector attached to the controller
final
validateOnChange bool
Defines if validation should be invoked on ValueListenable change
final
validator Validator<I>
Validator for defined stream
final
valueListenable ValueListenable<I>
ValueListenable with value that should be validated
final

Methods

attach(ValidationController<K> controller) → void
Attach connector to the validation controller
override
detach() → void
Detach connector from the validation controller
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate() String?
Validate current field value. Returns error message if current value is invalid
override
validateField() → void
Validates field, and pushes result to the ValidationController
inherited

Operators

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