ZenithMiddleware<T> class
abstract
Interceptor interface for observing, sanitizing, transforming, or canceling value mutations on a ZenithNode.
Implement this interface to create middleware for logging, value clamping, bearer token injection, analytics, or validation.
class ClampingMiddleware extends ZenithMiddleware<int> {
@override
int? onWillSet(ZenithNode<int> node, int currentValue, int newValue) {
return newValue.clamp(0, 100);
}
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDidSet(
ZenithNode< T> node, T value) → void -
Called after
valuehas been successfully assigned tonodeand subscribers have been notified. -
onWillSet(
ZenithNode< T> node, T currentValue, T newValue) → T? -
Called before
newValueis assigned tonode. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited