ZenithValidatedNode<T> class

A specialized ZenithNode that automatically validates T on creation and mutation.

Inheritance
Available extensions

Constructors

ZenithValidatedNode(T model, {required ZenithValidator<T> validator})
Creates a ZenithValidatedNode.

Properties

debugSubscriberCount → int
The current number of subscribers (including potentially dead weak references that have not yet been pruned).
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isDisposed → bool
Whether this node has been disposed.
no setterinherited
isValid → bool
Whether the current node model is valid.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
validationResult → ValidationResult
The current validation result containing errors.
no setter
validator → ZenithValidator<T>
The validator powering this node.
final
value ↔ T
The current value held by this node.
getter/setter pairinherited

Methods

dispose({bool purgeZeroize = false}) → void
Permanently disposes this node, clearing all subscribers.
inherited
errorsFor(String propertyName) → List<String>
Gets error messages for a specific propertyName.
guard(ZenithRef ref, Future<T> future()) → Future<void>

Available on ZenithNode<AsyncValue<T>>, provided by the SafeAsyncNodeX extension

Executes future and writes its result to this node, guarding every mutation with ref's lifecycle. Equivalent to ref.runAsync(this, future).
invalidate() → void
Forces a notification pass without changing the value.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifySubscribers() → void
Notifies all live subscribers that this node has changed.
inherited
set(T newValue) → void
Sets the value of this node and notifies all active subscribers.
override
subscribe(ZenithSubscriber subscriber) → ZenithSubscription
Adds subscriber to this node's listener set.
inherited
toString() → String
A string representation of this object.
inherited
trySet(T newValue) → bool
Attempts to update the value of this node.
inherited
unsubscribe(ZenithSubscriber subscriber) → void
Removes subscriber from this node's listener set.
inherited
watch(ZenithRef ref, Stream<T> stream) → StreamSubscription<T>

Available on ZenithNode<AsyncValue<T>>, provided by the StreamNodeX extension

Subscribes to stream and writes each event to this node, guarding every mutation with ref's lifecycle.

Operators

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