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<T>> node, Future<T> task()) → Future<void>
Safely runs task and updates node with AsyncLoading/AsyncData/AsyncError.
set<T>(ZenithNode<T> node, T value) → void
Safely mutates node if the controller is still mounted.
toString() → String
A string representation of this object.
inherited
watchStream<T>(ZenithNode<AsyncValue<T>> node, Stream<T> stream) → StreamSubscription<T>
Subscribes to stream and writes events to node, cancelling on disposal.

Operators

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