ZenithController class abstract
Base class for business logic controllers bound to a ZenithRef scope.
Encapsulates state mutations, async task execution, stream watching, and automatic lifecycle cleanup.
Constructors
- ZenithController(ZenithRef ref)
-
Creates a ZenithController and registers onDispose with
ref.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMounted → bool
-
Whether the owning container/scope is still mounted.
no setter
- ref → ZenithRef
-
The scoped ZenithRef managing this controller's lifecycle.
final
- 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
-
onDispose(
) → void - Called when the owning ZenithContainer or ZenithRef scope is disposed or reset.
-
onInit(
) → void - Called immediately upon controller creation.
-
runAsync<
T> (ZenithNode< AsyncValue< node, Future<T> >T> task()) → Future<void> -
Safely runs
taskand updatesnodewithAsyncLoading/AsyncData/AsyncError. -
set<
T> (ZenithNode< T> node, T value) → void -
Safely mutates
nodeif the controller is still mounted. -
toString(
) → String -
A string representation of this object.
inherited
-
watchStream<
T> (ZenithNode< AsyncValue< node, Stream<T> >T> stream) → StreamSubscription<T> -
Subscribes to
streamand writes events tonode, cancelling on disposal.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited