SubjectStreamValidationController<K> class

Validation controller that contains current state of validation.

Can be used to insert custom validation messages provided from API or can be managed by ValidationConnector's on data stream changes.

Works with BehaviorSubject stream controller.

Which means that all streams, that provided by this controller, will emit last value to the listeners as soon as they subscribe.

Inheritance
Implemented types

Constructors

SubjectStreamValidationController({bool sync = false, List<ValidationConnector<K, dynamic>> connectors = const []})
SubjectStreamValidationController.seeded(Map<K, String> errors, {bool sync = false, List<ValidationConnector<K, Object>> connectors = const []})

Properties

disposed bool
Returns true whenever controller is disposed
no setterinherited
errors Map<K, String>
Sync access to current validation error messages
no setteroverride
errorsStream Stream<Map<K, String>>
Stream with all validation error messages.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isValid bool
Sync access to validation state
no setterinherited
isValidStream Stream<bool>
Stream with current validation state
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addConnector(ValidationConnector<K, Object?> connector) → void
Add ValidationConnector to the active list.
inherited
addErrors(Map<K, String> errors) → void
Replace error messages
override
addFieldError(K field, String error) → void
Add error message for some particular field
inherited
attachConnectors(Iterable<ValidationConnector<K, Object?>> connectors) → void
Attach multiple ValidationConnector to the controller
inherited
clearErrors() → void
Clear all validation errors
inherited
clearFieldError(K field) → void
Remove error message from particular field
inherited
dispose() → void
Dispose method.
override
fieldError(K field) String?
Sync access to the validation error message if there is one
inherited
fieldErrorProvider(K field) StreamErrorProvider<K>
Provides ErrorProvider with validation error value for particular field.
override
fieldErrorStream(K field) Stream<String?>
Provides Stream with validation errors for particular field
override
fieldsError(Iterable<K> fields) Iterable<String>
Sync access to the validation error message if there is any.
inherited
fieldsErrorProvider(Iterable<K> fields) StreamErrorsProvider<K>
Provides ErrorsProvider with validation errors from multiple fields.
override
fieldsErrorStream(Iterable<K> fields) Stream<Iterable<String>>
Provides Stream with validation errors for multiple fields
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeConnector(ValidationConnector<K, Object?> connector) → void
Remove ValidationConnector.
inherited
toString() String
A string representation of this object.
inherited
validate() Future<void>
Invoke validation across all connected ValidationConnector
inherited

Operators

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