StreamValidationConnector<K, I> class

Validation Connector, that subscribes on provided Stream

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

Requires to be attached to the controller.

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

Inheritance
Implemented types

Constructors

StreamValidationConnector({required K field, required Stream<I> stream, required Validator<I> validator, bool validateOnChange = false, bool clearOnChange = true, bool validateOnAttach = false})
Creates default connector
StreamValidationConnector.seeded({required K field, required Stream<I> stream, required Validator<I> validator, required I initialValue, bool validateOnChange = false, bool clearOnChange = true, bool validateOnAttach = false})
Creates connector with seeded data

Properties

clearOnChange bool
Defines if error message should be removed when Stream 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
stream Stream<I>
Stream with value that should be validated
final
validateOnAttach bool
If value should be validated on connector attach
final
validateOnChange bool
Defines if validation should be invoked on Stream change
final
validator Validator<I>
Validator for defined stream
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
override

Operators

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