core/zenith/zenith_core library

Classes

AsyncData<T>
The successful state of an AsyncValue, holding the result value.
AsyncError<T>
The error state of an AsyncValue, holding the error and stackTrace.
AsyncLoading<T>
The loading state of an AsyncValue.
AsyncValue<T>
A sealed union representing the state of an asynchronous operation.
AuthAuthenticated<T>
State representing a successfully authenticated session with user data.
AuthAuthenticating<T>
State representing an active login or token verification in progress.
AuthError<T>
State representing a failed authentication attempt with error.
AuthState<T>
A sealed union representing authentication lifecycle states.
AuthUnauthenticated<T>
State representing an unauthenticated / logged-out session.
ComputedNode<T>
A read-only reactive node whose value is automatically derived from other ZenithNodes.
ConsoleSink
Standard console log sink using Flutter's debugPrint.
FeatureNode
A reactive ZenithNode holding the boolean status of a ZenithFeature.
InMemoryStorage
An in-memory implementation of ZenithStorage backed by a Dart Map.
MemoryRingBufferSink
In-memory ring buffer sink holding a fixed maximum capacity of recent logs.
PersistedNode<T>
A specialized ZenithNode that automatically restores state from a ZenithStorage backend on creation and saves updates on mutation.
PropertyRuleBuilder<T, V>
Rule builder for fluent property validation.
ValidationError
Single field validation error description.
ValidationResult
The result of evaluating a ZenithValidator against a model.
Zenith
Global configuration for the Zenith framework.
ZenithBuilder
A widget that subscribes to ZenithNodes read inside its builder closure and surgically rebuilds only when those nodes change.
ZenithCommand<R>
Base abstract class for a 1-to-1 command returning a value of type R.
ZenithConfigNode<T>
A strongly-typed configuration node that parses dynamic JSON/Map payloads (e.g. from Remote Config, local assets, or feature flags) into type T.
ZenithConsumer
An inline builder widget that subscribes to any ZenithNode read within builder.
ZenithConsumerWidget
A drop-in replacement for Riverpod's ConsumerWidget.
ZenithContainer
A scoped dependency injection container that manages ZenithNodes and their lifecycle.
ZenithController
Base class for business logic controllers bound to a ZenithRef scope.
ZenithEvent
Base abstract class for a 1-to-Many domain event.
ZenithFamily<T, Arg>
A strongly typed family identifier that creates a ZenithKey for any argument.
ZenithFamilyRegistry<T, Arg>
Tracks the keys created for one ZenithFamily within a logical scope.
ZenithFeature
Descriptor for a feature flag in flutter_zenith.
ZenithFeatureBuilder
A widget that reactively renders enabled or disabled based on a FeatureNode.
ZenithIsolateService<T, R>
A background service that spawns a dedicated background Dart Isolate worker.
ZenithKey<T>
A strongly typed identifier for nodes managed by a ZenithContainer.
ZenithListener<T>
A widget that fires listener callbacks for side-effects (navigation, dialogs, snackbars) whenever node changes, without triggering UI rebuilds.
ZenithLogEvent
A structured log event containing message template, properties, timestamp, and exception details.
ZenithLogger
A structured logging engine with automatic PII redaction and extensible sinks.
ZenithLogObserver
A built-in ZenithObserver that logs all events via debugPrint.
ZenithLogSink
Abstract destination interface for structured log events (e.g. Console, Sentry, Crashlytics, File).
ZenithMediator
An in-memory Command/Event Mediator engine for flutter_zenith.
ZenithMiddleware<T>
Interceptor interface for observing, sanitizing, transforming, or canceling value mutations on a ZenithNode.
ZenithMutation<T>
Represents the state and execution of a discrete asynchronous action.
ZenithNode<T>
An atomic, observable state cell holding a value of type T.
ZenithObserver
An observer that receives lifecycle events from the Zenith framework.
ZenithObserverTracker
Optional interface for subscribers that also want to track which nodes are being read (used internally by ZenithBuilder and ComputedNode for automatic dependency collection).
ZenithOverride<T>
Pairs a ZenithKey with a factory override function for testing or scoping. Registering a ZenithOverride with a ZenithContainer causes ZenithContainer.getOrCreate to use factory instead of the factory passed at the call site whenever key is requested.
ZenithPeriodicService
A background service that runs a periodic task every interval duration.
ZenithPipelineBehavior
Abstract pipeline behavior wrapping command execution for cross-cutting concerns (logging, timing, validation, metric capture).
ZenithRef
A scoped lifecycle handle for a single node's factory context.
ZenithResiliencePipeline
A resilience pipeline for retries, circuit breakers, and rate limiters.
ZenithScope
An InheritedWidget wrapper that binds a ZenithContainer to a subtree of the widget tree.
ZenithScopeGuard
A version token that invalidates asynchronous work when its logical scope changes, such as navigating away, switching accounts, or selecting another document.
ZenithScopeToken
An immutable snapshot of a ZenithScopeGuard's current generation.
ZenithSelector<T, R>
A widget that rebuilds only when a selected portion of a ZenithNode's value changes.
ZenithService
Abstract contract for background hosted services bound to container scope lifecycles.
ZenithServiceRegistration
Observable startup and shutdown for a registered service.
ZenithState<T extends ZenithStatefulWidget>
The state class for a ZenithStatefulWidget.
ZenithStatefulWidget
A stateful widget that integrates with Zenith state management.
ZenithStorage
Abstract storage interface for state persistence in flutter_zenith.
ZenithSubscriber
ZenithValidatedNode<T>
A specialized ZenithNode that automatically validates T on creation and mutation.
ZenithValidator<T>
Abstract base validator class for fluent model validation.
ZenithZone
Global zone state for automatic dependency tracking.
Zeroizable
Interface for objects that hold sensitive memory buffers (cryptographic keys, tokens, PII) and must overwrite them with zeros on disposal.

Enums

CircuitState
Circuit breaker state machine enum.
ConcurrencyStrategy
Strategies for handling back-to-back async calls that write to the same ZenithNode.
ZenithEnvironment
Application runtime environments for flutter_zenith.
ZenithLogLevel
Log severity levels.

Mixins

ZenithSafeRebuild<T extends StatefulWidget>
Defers State.setState (and other UI work) when Flutter is already building, laying out, or painting.
ZenithStateMixin<T extends StatefulWidget>
A mixin that can be added to any Flutter State to gain reactive Zenith capabilities and convenient node helpers without changing the widget's base class.

Extensions

SafeAsyncNodeX on ZenithNode<AsyncValue<T>>
Adds mounted-safe async execution helpers directly on async state nodes.
StreamNodeX on ZenithNode<AsyncValue<T>>
Adds stream subscription helpers directly on AsyncValue nodes.
ZenithConcurrencyX on ZenithRef
Adds concurrency-guarded async execution to ZenithRef.
ZenithContextX on BuildContext
Ergonomic helpers so widgets can access the current ZenithContainer directly from a BuildContext without a verbose ZenithScope.of call.
ZenithIsolateX on ZenithRef
Adds background-isolate execution to ZenithRef.
ZenithLoggerContainerX on ZenithContainer
Extension on ZenithContainer and ZenithRef for structured logger access.
ZenithLoggerRefX on ZenithRef
Extension on ZenithRef for logger access.
ZenithMediatorContainerX on ZenithContainer
Extension on ZenithContainer and ZenithRef giving access to ZenithMediator.
ZenithMediatorRefX on ZenithRef
Extension on ZenithRef for mediator access.
ZenithResilienceRefX on ZenithRef
Extension on ZenithRef providing resilient execution.
ZenithServiceRefX on ZenithRef
Service registration bound to a ref's asynchronous cleanup.
ZenithStreamX on ZenithRef
Adds stream subscription helpers to ZenithRef.

Typedefs

NodeKey = Object
The key type used for node lookup in a ZenithContainer.
ZenithCommandHandler<C extends ZenithCommand<R>, R> = FutureOr<R> Function(ZenithRef ref, C command)
Function signature for command execution handlers.
ZenithEventHandler<E extends ZenithEvent> = FutureOr<void> Function(ZenithRef ref, E event)
Function signature for domain event listeners.
ZenithSubscription = void Function()
Interface for objects that want to be notified when a ZenithNode changes.

Exceptions / Errors

ZenithCaptiveDependencyException
Thrown when a singleton lifetime registration attempts to directly resolve a scoped dependency from a child/scoped container.