levit library
Recommended single-import kit for pure Dart Levit applications.
This library re-exports package:levit_dart/levit_dart.dart, which includes
Levit's Dart composition layer (levit_dart_core) and foundational runtime
packages (levit_scope and levit_reactive) through transitive exports.
Use this package for CLI, server, and shared-domain code that does not need Flutter widget bindings.
Classes
- InMemoryTaskCacheProvider
- A default in-memory implementation of LevitTaskCacheProvider.
- Levit
- The central entry point for the Levit framework.
-
LevitAsyncStore<
T> - A specialized store for asynchronous initialization.
- LevitController
- A base class for business logic components.
-
LevitDependency<
S> - Metadata container for a dependency registered within a LevitScope.
- LevitDisposable
- A resource with an explicit, optionally asynchronous disposal operation.
- LevitDisposalFailure
- One failure captured while a scope or resource owner was being disposed.
- LevitIsolateTaskContext
- Message-safe context provided inside a task isolate.
- LevitLoopEngine
- A standalone execution engine for managing repetitive loops and long-running services.
- LevitReactiveBatch
- A collection of LevitReactiveChanges captured during a batch operation.
-
LevitReactiveChange<
T> - Represents a state transition in a reactive variable.
- LevitReactiveHistoryMiddleware
- A standard middleware for recording the state history.
- LevitReactiveMiddleware
- Base class for intercepting reactive system events.
- LevitReactiveNotifier
- A low-latency notifier for synchronous reactive updates.
- LevitReactiveObserver
- An observer interface used to automatically track reactive dependencies.
- LevitReactiveReadResolver
- Optional interface for observers that can canonicalize reactive reads.
- LevitRef
- A bridge for interacting with the dependency injection system from a LevitStore.
- LevitResourceOwner
- A lifecycle boundary that owns arbitrary cleanup resources.
- LevitScope
- A hierarchical dependency injection container.
- LevitScopeDisposable
- An interface for objects that participate in the LevitScope lifecycle.
- LevitScopeKey
- Typed key for dependency registrations.
- LevitScopeMiddleware
- Interface for observing and intercepting LevitScope lifecycle events.
-
LevitStore<
T> - A portable container definition for managing reusable state.
- LevitTaskCacheProvider
- Interface for persistent task result caching.
- LevitTaskContext
- Context passed to every task attempt.
- LevitTaskEngine
- A standalone engine for named, cancellable asynchronous work.
- LevitTaskEvent
- Structured lifecycle event emitted by LevitTaskEngine.
-
LevitTaskExecution<
T> - A lightweight handle for one scheduled or joined execution.
- LevitTaskExecutionSummary
- A dependency-free summary retained by LevitTaskTracker.
- LevitTaskMetadata
- Stable, low-cardinality metadata attached to task executions.
- LevitTaskMiddleware
- Receives task events from every LevitTaskEngine in this isolate.
- LevitTaskTracker
- Optional reactive middleware for application-level aggregate task UI.
- Ls
- The global entry point for accessing the LevitScope system.
- Lx
- The global entry point for the Levit reactive engine.
-
LxAsyncComputed<
T> - An asynchronous computed value that reflects state transitions via LxStatus.
-
LxBase<
T> - The primary implementation base for reactive objects.
- LxBool
- A reactive boolean with specialized toggling methods.
-
LxComputed<
T> - A value derived from other reactive objects.
- LxCountdown
- A reactive countdown timer.
- LxDouble
- A reactive double with arithmetic extensions.
-
LxError<
T> - Status: Error (the operation failed).
-
LxFamily<
K, R extends LxReactive> - Lazily creates, caches, and disposes reactive resources by key.
- LxFamilyEviction
- Cache eviction policy for LxFamily entries.
- LxFamilyKeepAlive
- An eviction policy that retains every family entry.
- LxFamilyWhenInactive
- An eviction policy based on reactive listener activity.
-
LxFuture<
T> - A reactive wrapper for a Future.
-
LxIdle<
T> - Status: Idle (the operation has not been initiated).
- LxInt
- A reactive integer with arithmetic extensions.
-
LxList<
E> - A reactive list that notifies observers on modification.
- LxListenerContext
- A standard context descriptor for reactive listeners.
-
LxMap<
K, V> - A reactive map that notifies observers on modification.
-
LxReactive<
T> - The foundational interface for all reactive objects.
-
LxSet<
E> - A reactive set that notifies observers on modification.
-
LxState<
T> - A reactive state container for immutable data flow.
-
LxStatus<
T> - A sealed hierarchy representing the status of an asynchronous operation.
-
LxStream<
T> - A reactive wrapper for a Stream.
-
LxSuccess<
T> - Status: Success (the operation completed with a result).
-
LxVar<
T> - A reactive variable that holds a mutable value.
-
LxWaiting<
T> - Status: Waiting (the operation is active).
-
LxWorker<
T> - A reactive observer for side-effects.
- LxWorkerStat
- Performance metrics for an LxWorker.
- StoppableService
- A service that can be started, paused, resumed, and stopped.
-
TaskCachePolicy<
T> - Configuration for caching a task's result.
- TaskDetails
- Represents the latest tracked execution of a logical task.
Enums
- LevitTaskEventType
- Lifecycle event types emitted by LevitTaskEngine.
- LevitTaskOutcome
- Terminal outcomes for task executions and rejected submissions.
- LevitTaskPhase
- The scheduling phase represented by a LevitTaskEvent.
- LevitTaskSubmissionDisposition
- How a submitted task related to existing work.
- LxAsyncConcurrency
- Controls admission of overlapping asynchronous reactive computations.
- LxStreamCompletionPolicy
- Determines what an LxStream does when its current source completes.
- TaskConflictPolicy
- Defines what happens when a logical task ID already has pending work.
- TaskPriority
- Priority levels for task execution.
- TaskSkipReason
- Reasons why a task execution was skipped.
Mixins
- LevitLoopExecutionMixin
- A mixin for LevitController that manages background loops and stoppable services.
- LevitReactiveTasksMixin
- Adds reactive task state and selectors to LevitController.
- LevitResourceOwnership
- Reusable implementation of LevitResourceOwner.
-
LevitSelectionMixin<
T> - A mixin for LevitController that manages selection state.
- LevitTasksMixin
- Adds named task execution, conflict policies, retries, and cancellation.
- LevitTimeMixin
- A mixin for LevitController that centralizes time-based operations like debouncing, throttling, intervals, and countdowns.
Extensions
-
LevitAsyncBuilderExtension
on Future<
T> Function() - Extensions for registering asynchronous builder functions.
-
LevitAsyncInstanceExtension
on Future<
T> - Extensions for registering asynchronous dependencies.
- LevitBuilderExtension on T Function()
- Extensions for registering builder functions.
- LevitInstanceExtension on T
- Extensions for registering instances directly into the active LevitScope.
- LevitScopeImplicitScopeExtension on LevitScope
- Extensions for executing code within a specific LevitScope.
- LevitScopeToBuilderExtension on T
- Extension to convert any object to a builder function.
-
LxAsyncFunctionExtension
on Future<
T> Function() - Extension to create LxAsyncComputed from an asynchronous function.
- LxBoolExtension on bool
-
Specialized
.lxextension for booleans. - LxDoubleExtension on double
- Specialized extensions for double.
- LxExtension on T
- Extensions to create reactive variables from primitive values.
- LxFunctionExtension on T Function()
- Extension to create LxComputed from a synchronous function.
-
LxFutureExtension
on Future<
T> - Extensions for converting Futures to LxFutures.
- LxIntExtension on int
-
Specialized
.lxextension for integers. -
LxListExtension
on List<
E> - Helper extensions for creating reactive collections.
-
LxMapExtension
on Map<
K, V> - Helper extensions for creating reactive maps.
- LxNamingExtension on R
- Fluent extensions for naming and configuring reactive objects.
-
LxReactiveWatchExtensions
on LxReactive<
T> - Extensions for creating watchers from any reactive source.
-
LxSetExtension
on Set<
E> - Helper extensions for creating reactive sets.
-
LxStatusReactiveExtensions
on LxReactive<
LxStatus< T> > - Ergonomic extensions for interacting with reactive async status sources.
-
LxStreamExtension
on Stream<
T> - Extensions for converting Streams to LxStreams.
Properties
- autoLinkCaptureKeyForTesting → Object
-
no setter
Functions
-
requireStoreRefScope(
LevitScope? scope) → LevitScope -
Returns
scopeor throws when a LevitRef is used before scope attachment. -
runCapturedForTesting<
R> (R builder(), [String? ownerId]) → R
Typedefs
-
LevitIsolateTask<
I, T> = FutureOr< T> Function(I input, LevitIsolateTaskContext context) - A top-level or static task entrypoint suitable for isolate execution.
- LxOnBatch = dynamic Function() Function(dynamic next(), LevitReactiveBatch change)
- Helper typedefs for middleware interception.
- LxOnDispose = void Function() Function(void next(), LxReactive reactive)
- Helper typedefs for middleware interception.
- LxOnSet = void Function(dynamic value) Function(void next(dynamic value), LxReactive reactive, LevitReactiveChange change)
- Helper typedefs for middleware interception.
Exceptions / Errors
- LevitDisposalException
- Aggregate error thrown after best-effort disposal has finished.
- LevitTaskCancelledException
- Thrown by LevitTaskContext.throwIfCancelled after cancellation.
- TaskConflictException
- Describes a logical task conflict rejected by the engine.