df_di library

A pragmatic dependency injection (DI) system, coupled with service classes for seamless state management in Dart.

Classes

Async<T extends Object>
A Outcome that represents a Resolvable that holds an asynchronous Result.
AsyncImpl<T extends Object>
Bundle
Bundles let you spawn a fixed set of components with one call. Bevy's equivalent of the Bundle trait.
Component
Marker base class for components — the data half of the ECS, attached to a WorldEntity. Inspired by Bevy: components are immutable values; logic lives in Systems, not on the components themselves. One concrete subclass per entity (a second add replaces the first).
ConcurrentTaskBatch<T extends Object>
A task batch that executes its collection of tasks concurrently.
DefaultEntity
The fallback group entity used when no groupEntity is supplied to a register* / get* call.
DevEntity
Group entity recommended for development-only dependencies such as debugging tools or mock services. Backs DI.dev.
DI
EcsPlugin
A reusable bundle of systems, resources, and event wiring for an ECS World. Named to distinguish it from the app-level Plugin (which owns a DI scope rather than a World). Bevy's Plugin trait.
Entity
An entity is a uniquely identifiable object that serves as a container or identifier for components in a Dependency Injection (DI) or Entity-Component-System (ECS) framework.
ErrModel
Generated class for _ErrModel.
Event
Marker base class for events dispatched through World.sendEvent.
ExperimentalAnnotation1
The class that enables the @experimental1 annotation.
ExperimentalAnnotation2
The class that enables the @experimental2 annotation.
ExperimentalAnnotation3
The class that enables the @experimental3 annotation.
FunctionSystem
A System implemented with callbacks. Useful for one-off behaviour or prototypes where a full subclass would be overkill.
GenericEntity<T>
GlobalEntity
Group entity recommended for application-wide dependencies that should be accessible regardless of the current scope. Backs DI.global.
Here
A utility class for capturing the current code location (file, line, column, member).
Lazy<T extends Object>
A class that provides lazy initialization for instances of type T.
MustAwaitAllFuturesAnnotation
The class that enables the @mustAwaitAllFutures annotation.
MustAwaitAllFuturesOrErrorAnnotation
The class that enables the @mustAwaitAllFuturesOrError annotation.
MustBeAnonymousAnnotation
The class that enables the @mustBeAnonymous annotation.
MustBeAnonymousOrErrorAnnotation
The class that enables the @mustBeAnonymousOrError annotation.
MustBeStrongRefAnnotation
The class that enables the @mustBeStrongRef annotation.
MustBeStrongRefOrErrorAnnotation
The class that enables the @mustBeStrongRefOrError annotation.
MustHandleReturnAnnotation
The class that enables the @mustHandleReturn annotation.
MustHandleReturnOrErrorAnnotation
The class that enables the @mustHandleReturnOrError annotation.
NoFuturesAnnotation
The class that enables the @noFutures annotation.
NoFuturesOrErrorAnnotation
The class that enables the @noFuturesOrError annotation.
None<T extends Object>
A Outcome that represents an Option that does not contain a value.
Ok<T extends Object>
A Outcome that represents the success case of a Result, containing a value.
Option<T extends Object>
A Outcome that represents an optional value: every Option is either Some and contains a value, or None and does not.
Outcome<T extends Object>
The foundational sealed class for all Outcome types like Option, Result and Resolvable.
Plugin
An app-level plugin: a self-contained bundle of services, resources, and behaviour that can be installed into a DI scope at runtime and removed cleanly later. Use these to make whole features pluggable — themes, auth providers, analytics backends, optional integrations, etc.
PollingStreamService<TData extends Object>
Convenience base class for PollingStreamServiceMixin. Use this if you don't need to extend another class.
ProdEntity
Group entity recommended for production-only dependencies. Backs DI.prod.
Resolvable<T extends Object>
A Outcome that represents a value which can be resolved either synchronously Sync or asynchronously Async.
Resource
Marker base class for resources — global, type-keyed state that is not attached to any entity (time, input, config, scoreboards, RNGs, etc.). Bevy's equivalent of Res<T> / ResMut<T>.
Result<T extends Object>
A Outcome that represents the result of an operation: every Result is either Ok and contains a success value, or Err and contains an error value.
SafeCompleter<T extends Object>
A wrapper around Dart's Completer that prevents it from being completed more than once.
SendableAnnotation
The class that enables the @sendable annotation.
SendableOrErrorAnnotation
The class that enables the @sendableOrError annotation.
SequencedTaskBatch<T extends Object>
A batch of tasks designed to be executed sequentially by a TaskSequencer.
Service
Convenience base class for ServiceMixin. Use this if you don't need to extend another class; otherwise mix in ServiceMixin directly.
SessionEntity
Group entity recommended for session-scoped dependencies (e.g. anything tied to the current sign-in). Backs DI.session.
Some<T extends Object>
A Outcome that represents an Option that contains a value.
StreamService<TData extends Object>
Convenience base class for StreamServiceMixin. Use this if you don't need to extend another class.
StrictEqualityEntity
Marker for entities whose equality is stricter than the base id-based contract (e.g. UniqueEntity). Entity.== refuses to claim equality from the loose side when other carries this marker, keeping == symmetric — required for HashMap correctness. Subtypes must override == themselves to enforce the stricter rule.
Sync<T extends Object>
A Outcome that represents a Resolvable that holds a synchronous Result.
SyncImpl<T extends Object>
System
Logic that operates on a World every tick. Systems are stateless about which entities they touch — they query the world each call.
Task<T extends Object>
A data class representing a single, configured task in a sequence.
TaskBatchBase<T extends Object>
Provides a foundational structure for managing a collection of tasks.
TaskSequencer<T extends Object>
Manages a chain of dependent tasks, ensuring they execute sequentially.
TestEntity
Group entity recommended for test-only dependencies. Backs DI.test.
ThemeEntity
Group entity recommended for theme-related dependencies. Backs DI.theme.
TypeEntity
Constructs a Entity representation by replacing occurrences of Object or dynamic in the baseType with corresponding values from subTypes. The replacements are applied sequentially based on their order in subTypes.
UniqueEntity
An Entity identified by a 128-bit RFC 4122 v4 uuid. Equality always consults the UUID, so id collisions with other entities (32-bit hash space) are harmless. Sendable across isolates: the UUID survives a SendPort round trip and the receiving instance compares equal to the original.
Unit
A type representing a "no value" unit, similar to void but usable in generics.
UnsafeAnnotation
The class that enables the @unsafe annotation.
UnsafeOrErrorAnnotation
The class that enables the @unsafeOrError annotation.
UserEntity
Group entity recommended for user-specific dependencies (preferences, per-user state). Backs DI.user.
Waiter<T>
Manages a collection of operations for deferred, batched execution.
WaiterOperation<T>
An immutable, value-shaped descriptor of a deferred operation managed by Waiter.
World
A Bevy-inspired Entity-Component-System container backed by DIRegistry.
WorldEntity
A lightweight handle to an entity inside a specific World. Equality is based on Entity.id; do not compare entities from different worlds.

Enums

ServiceState
Full lifecycle state for a ServiceMixin. Each lifecycle phase has three substates: _ATTEMPT (listeners running), _SUCCESS (all listeners ran cleanly), and _ERROR (at least one listener errored).

Mixins

PollingStreamServiceMixin<TData extends Object>
Drives a StreamServiceMixin's input stream by invoking onPoll on a fixed providePollingInterval. The underlying timer is automatically stopped on pause / dispose and restarted on resume via the subscription's onPause / onResume callbacks.
ServiceMixin
Adds a sequenced lifecycle (init → pause/resume* → dispose) to any class.
StreamServiceMixin<TData extends Object>
Adds a managed broadcast stream to a ServiceMixin. Subclasses provide an input stream via provideInputStream; the mixin wires it through a broadcast controller, exposes it via stream, and forwards every emission through pushToStream (which runs provideOnPushToStreamListeners in arrival order via a single per-service sequencer).

Extensions

AsyncOptionExt on Async<Option<T>>
FlattenAsyncExt2 on Async<Async<T>>
FlattenAsyncExt3 on Async<Async<Async<T>>>
FlattenAsyncExt4 on Async<Async<Async<Async<T>>>>
FlattenAsyncExt5 on Async<Async<Async<Async<Async<T>>>>>
FlattenAsyncExt6 on Async<Async<Async<Async<Async<Async<T>>>>>>
FlattenAsyncExt7 on Async<Async<Async<Async<Async<Async<Async<T>>>>>>>
FlattenAsyncExt8 on Async<Async<Async<Async<Async<Async<Async<Async<T>>>>>>>>
FlattenAsyncExt9 on Async<Async<Async<Async<Async<Async<Async<Async<Async<T>>>>>>>>>
FlattenErrExt2 on Err<Err<T>>
FlattenErrExt3 on Err<Err<Err<T>>>
FlattenErrExt4 on Err<Err<Err<Err<T>>>>
FlattenErrExt5 on Err<Err<Err<Err<Err<T>>>>>
FlattenErrExt6 on Err<Err<Err<Err<Err<Err<T>>>>>>
FlattenErrExt7 on Err<Err<Err<Err<Err<Err<Err<T>>>>>>>
FlattenErrExt8 on Err<Err<Err<Err<Err<Err<Err<Err<T>>>>>>>>
FlattenErrExt9 on Err<Err<Err<Err<Err<Err<Err<Err<Err<T>>>>>>>>>
FlattenNoneExt2 on None<None<T>>
FlattenNoneExt3 on None<None<None<T>>>
FlattenNoneExt4 on None<None<None<None<T>>>>
FlattenNoneExt5 on None<None<None<None<None<T>>>>>
FlattenNoneExt6 on None<None<None<None<None<None<T>>>>>>
FlattenNoneExt7 on None<None<None<None<None<None<None<T>>>>>>>
FlattenNoneExt8 on None<None<None<None<None<None<None<None<T>>>>>>>>
FlattenNoneExt9 on None<None<None<None<None<None<None<None<None<T>>>>>>>>>
FlattenOkExt2 on Ok<Ok<T>>
FlattenOkExt3 on Ok<Ok<Ok<T>>>
FlattenOkExt4 on Ok<Ok<Ok<Ok<T>>>>
FlattenOkExt5 on Ok<Ok<Ok<Ok<Ok<T>>>>>
FlattenOkExt6 on Ok<Ok<Ok<Ok<Ok<Ok<T>>>>>>
FlattenOkExt7 on Ok<Ok<Ok<Ok<Ok<Ok<Ok<T>>>>>>>
FlattenOkExt8 on Ok<Ok<Ok<Ok<Ok<Ok<Ok<Ok<T>>>>>>>>
FlattenOkExt9 on Ok<Ok<Ok<Ok<Ok<Ok<Ok<Ok<Ok<T>>>>>>>>>
FlattenOptionExt2 on Option<Option<T>>
FlattenOptionExt3 on Option<Option<Option<T>>>
FlattenOptionExt4 on Option<Option<Option<Option<T>>>>
FlattenOptionExt5 on Option<Option<Option<Option<Option<T>>>>>
FlattenOptionExt6 on Option<Option<Option<Option<Option<Option<T>>>>>>
FlattenOptionExt7 on Option<Option<Option<Option<Option<Option<Option<T>>>>>>>
FlattenOptionExt8 on Option<Option<Option<Option<Option<Option<Option<Option<T>>>>>>>>
FlattenOptionExt9 on Option<Option<Option<Option<Option<Option<Option<Option<Option<T>>>>>>>>>
FlattenResolvableExt2 on Resolvable<Resolvable<T>>
FlattenResolvableExt3 on Resolvable<Resolvable<Resolvable<T>>>
FlattenResolvableExt4 on Resolvable<Resolvable<Resolvable<Resolvable<T>>>>
FlattenResolvableExt5 on Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<T>>>>>
FlattenResolvableExt6 on Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<T>>>>>>
FlattenResolvableExt7 on Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<T>>>>>>>
FlattenResolvableExt8 on Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<T>>>>>>>>
FlattenResolvableExt9 on Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<Resolvable<T>>>>>>>>>
FlattenResolvableResulteExt3 on Resolvable<Result<Result<T>>>
FlattenResolvableResulteExt4 on Resolvable<Result<Result<Result<T>>>>
FlattenResolvableResulteExt5 on Resolvable<Result<Result<Result<Result<T>>>>>
FlattenResolvableResulteExt6 on Resolvable<Result<Result<Result<Result<Result<T>>>>>>
FlattenResolvableResulteExt7 on Resolvable<Result<Result<Result<Result<Result<Result<T>>>>>>>
FlattenResolvableResulteExt8 on Resolvable<Result<Result<Result<Result<Result<Result<Result<T>>>>>>>>
FlattenResolvableResulteExt9 on Resolvable<Result<Result<Result<Result<Result<Result<Result<Result<T>>>>>>>>>
FlattenResolvableResultExt2 on Resolvable<Result<T>>
FlattenResultExt2 on Result<Result<T>>
FlattenResultExt3 on Result<Result<Result<T>>>
FlattenResultExt4 on Result<Result<Result<Result<T>>>>
FlattenResultExt5 on Result<Result<Result<Result<Result<T>>>>>
FlattenResultExt6 on Result<Result<Result<Result<Result<Result<T>>>>>>
FlattenResultExt7 on Result<Result<Result<Result<Result<Result<Result<T>>>>>>>
FlattenResultExt8 on Result<Result<Result<Result<Result<Result<Result<Result<T>>>>>>>>
FlattenResultExt9 on Result<Result<Result<Result<Result<Result<Result<Result<Result<T>>>>>>>>>
FlattenSomeExt2 on Some<Some<T>>
FlattenSomeExt3 on Some<Some<Some<T>>>
FlattenSomeExt4 on Some<Some<Some<Some<T>>>>
FlattenSomeExt5 on Some<Some<Some<Some<Some<T>>>>>
FlattenSomeExt6 on Some<Some<Some<Some<Some<Some<T>>>>>>
FlattenSomeExt7 on Some<Some<Some<Some<Some<Some<Some<T>>>>>>>
FlattenSomeExt8 on Some<Some<Some<Some<Some<Some<Some<Some<T>>>>>>>>
FlattenSomeExt9 on Some<Some<Some<Some<Some<Some<Some<Some<Some<T>>>>>>>>>
FlattenSyncExt2 on Sync<Sync<T>>
FlattenSyncExt3 on Sync<Sync<Sync<T>>>
FlattenSyncExt4 on Sync<Sync<Sync<Sync<T>>>>
FlattenSyncExt5 on Sync<Sync<Sync<Sync<Sync<T>>>>>
FlattenSyncExt6 on Sync<Sync<Sync<Sync<Sync<Sync<T>>>>>>
FlattenSyncExt7 on Sync<Sync<Sync<Sync<Sync<Sync<Sync<T>>>>>>>
FlattenSyncExt8 on Sync<Sync<Sync<Sync<Sync<Sync<Sync<Sync<T>>>>>>>>
FlattenSyncExt9 on Sync<Sync<Sync<Sync<Sync<Sync<Sync<Sync<Sync<T>>>>>>>>>
FutureIterableOkExt on Future<Iterable<Ok<T>>>
FutureIterableSomeExt on Future<Iterable<Some<T>>>
FutureOrExt on FutureOr<T>
Convenience methods for inspecting and converting a FutureOr.
IterableAsyncExt on Iterable<Async<T>>
IterableExt on Iterable<T>
IterableFutureOptionExt on Iterable<Future<Option<T>>>
IterableFutureResultExt on Iterable<Future<Result<T>>>
IterableOkExt on Iterable<Ok<T>>
IterableOptionExt on Iterable<Option<T>>
IterableResolvableExt on Iterable<Resolvable<T>>
IterableResultExt on Iterable<Result<T>>
IterableSomeExt on Iterable<Some<T>>
IterableSyncExt on Iterable<Sync<T>>
MapExt on Map<K, V>
MapOfOptions on Map<K, Option<V>>
MapOfResults on Map<K, Result<V>>
MapOutcomeExt10 on Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Object>>>>>>>>>>
MapOutcomeExt2 on Outcome<Outcome<Object>>
MapOutcomeExt3 on Outcome<Outcome<Outcome<Object>>>
MapOutcomeExt4 on Outcome<Outcome<Outcome<Outcome<Object>>>>
MapOutcomeExt5 on Outcome<Outcome<Outcome<Outcome<Outcome<Object>>>>>
MapOutcomeExt6 on Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Object>>>>>>
MapOutcomeExt7 on Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Object>>>>>>>
MapOutcomeExt8 on Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Object>>>>>>>>
MapOutcomeExt9 on Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Outcome<Object>>>>>>>>>
NamedAsyncExt on Async<T>
Adds NamedAsyncExt.named to Async with the same semantics as NamedResultExt.named.
NamedResolvableExt on Resolvable<T>
Adds NamedResolvableExt.named to Resolvable so both Sync and Async subtypes are addressable through the base type.
NamedResultExt on Result<T>
Adds NamedResultExt.named to Result for failure attribution: if the receiver is an Err that has not yet been labelled by an upstream .named(), the label is recorded in Err.breadcrumbs. If it already carries breadcrumbs (an upstream node already claimed the failure), this is a no-op so the originating step keeps its credit.
NamedSyncExt on Sync<T>
Adds NamedSyncExt.named to Sync with the same semantics as NamedResultExt.named.
NoneIfEmptyOnListExt on List<T>
NoneIfEmptyOnSetExt on Set<T>
PluginHostX on DI
ResolvableOptionExt on Resolvable<Option<T>>
StringExt on String
SwapAsyncNoneExt on Async<None<T>>
SwapAsyncOkExt on Async<Ok<T>>
SwapAsyncSomeExt on Async<Some<T>>
SwapErrAsyncExt on Err<Async<T>>
SwapErrNoneExt on Err<None<T>>
SwapErrOkExt on Err<Ok<T>>
SwapErrOptionExt on Err<Option<T>>
SwapErrResolvableExt on Err<Resolvable<T>>
SwapErrResultExt on Err<Result<T>>
SwapErrSomeExt on Err<Some<T>>
SwapErrSyncExt on Err<Sync<T>>
SwapNoneAsyncExt on None<Async<T>>
SwapNoneErrExt on None<Err<T>>
SwapNoneOkExt on None<Ok<T>>
SwapNoneOptionExt on None<Option<T>>
SwapNoneResolvableExt on None<Resolvable<T>>
SwapNoneResultExt on None<Result<T>>
SwapNoneSomeExt on None<Some<T>>
SwapNoneSyncExt on None<Sync<T>>
SwapOkAsyncExt on Ok<Async<T>>
SwapOkErrExt on Ok<Err<T>>
SwapOkNoneExt on Ok<None<T>>
SwapOkOptionExt on Ok<Option<T>>
SwapOkResolvableExt on Ok<Resolvable<T>>
SwapOkResultExt on Ok<Result<T>>
SwapOkSomeExt on Ok<Some<T>>
SwapOkSyncExt on Ok<Sync<T>>
SwapOptionAsyncExt on Option<Async<T>>
SwapOptionErrExt on Option<Err<T>>
SwapOptionNoneExt on Option<None<T>>
SwapOptionOkExt on Option<Ok<T>>
SwapOptionResolvableExt on Option<Resolvable<T>>
SwapOptionResultExt on Option<Result<T>>
SwapOptionSomeExt on Option<Some<T>>
SwapOptionSyncExt on Option<Sync<T>>
SwapResolvableNoneExt on Resolvable<None<T>>
SwapResolvableOkExt on Resolvable<Ok<T>>
SwapResolvableSomeExt on Resolvable<Some<T>>
SwapResultAsyncExt on Result<Async<T>>
SwapResultErrExt on Result<Err<T>>
SwapResultNoneExt on Result<None<T>>
SwapResultOkExt on Result<Ok<T>>
SwapResultOptionExt on Result<Option<T>>
SwapResultResolvableExt on Result<Resolvable<T>>
SwapResultSomeExt on Result<Some<T>>
SwapResultSyncExt on Result<Sync<T>>
SwapSomeAsyncExt on Some<Async<T>>
SwapSomeErrExt on Some<Err<T>>
SwapSomeNoneExt on Some<None<T>>
SwapSomeOkExt on Some<Ok<T>>
SwapSomeOptionExt on Some<Option<T>>
SwapSomeResolvableExt on Some<Resolvable<T>>
SwapSomeResultExt on Some<Result<T>>
SwapSomeSyncExt on Some<Sync<T>>
SwapSyncAsyncExt on Sync<Async<T>>
SwapSyncErrExt on Sync<Err<T>>
SwapSyncNoneExt on Sync<None<T>>
SwapSyncOkExt on Sync<Ok<T>>
SwapSyncOptionExt on Sync<Option<T>>
SwapSyncResolvableExt on Sync<Resolvable<T>>
SwapSyncResultExt on Sync<Result<T>>
SwapSyncSomeExt on Sync<Some<T>>
SyncOptionExt on Sync<Option<T>>
ToAsyncExt on Future<T>
ToResolvableExt on FutureOr<T>
ToSafeStreamExt on Stream<T>
An extension on Stream to provide a safe way to handle stream events.
ToSync on T
ToUnitOnObjectAsync on Async<Object>
ToUnitOnObjectErr on Err<Object>
ToUnitOnObjectNone on None<Object>
ToUnitOnObjectOk on Ok<Object>
ToUnitOnObjectOption on Option<Object>
ToUnitOnObjectOutcome on Outcome<Object>
ToUnitOnObjectResolvable on Resolvable<Object>
ToUnitOnObjectResult on Result<Object>
ToUnitOnObjectSome on Some<Object>
ToUnitOnObjectSync on Sync<Object>
ToUnitOnVoidAsync on Async<void>
ToUnitOnVoidErr on Err<void>
ToUnitOnVoidNone on None<void>
ToUnitOnVoidOk on Ok<void>
ToUnitOnVoidOption on Option<void>
ToUnitOnVoidOutcome on Outcome<void>
ToUnitOnVoidResolvable on Resolvable<void>
ToUnitOnVoidResult on Result<void>
ToUnitOnVoidSome on Some<void>
ToUnitOnVoidSync on Sync<void>
ToVoidOnAsyncExt on Async<T>
ToVoidOnErrExt on Err<T>
ToVoidOnNoneExt on None<T>
ToVoidOnOkExt on Ok<T>
ToVoidOnOptionExt on Option<T>
ToVoidOnOutcomeExt on Outcome<T>
ToVoidOnResolvableExt on Resolvable<T>
ToVoidOnResultExt on Result<T>
ToVoidOnSomeExt on Some<T>
ToVoidOnSyncExt on Sync<T>
TryCallOnFunctionExt on Function
Provides a safe, dynamic invocation method for any Function.
ValueOfOnEnumExt on Iterable<T>
Provides a safe, string-based lookup method for enum iterables.
WrapOnAsyncExt on Async<T>
WrapOnErrExt on Err<T>
WrapOnNoneExt on None<T>
WrapOnOkExt on Ok<T>
WrapOnOptionExt on Option<T>
WrapOnOutcomeExt on M
WrapOnResolvableExt on Resolvable<T>
WrapOnResultExt on Result<T>
WrapOnSomeExt on Some<T>
WrapOnSyncExt on Sync<T>

Constants

defaultDecodeJsonbStringsMaxDepth → const int
The default recursion depth for decodeJsonbStrings.
experimental1 → const ExperimentalAnnotation1
experimental2 → const ExperimentalAnnotation2
experimental3 → const ExperimentalAnnotation3
jsSafeIntegerBound → const double
2^53 — the largest integer that JS Number (IEEE 754 double) can represent exactly. Beyond this, integer arithmetic silently loses precision. Used as the safe-integer bound on the JS runtime.
kIsDartLibraryUI → const bool
A constatnt that can be used to check if your app is running in a Dart only or Flutter environment. It's true if dart.library.ui is defined and false otherwise.
mustAwaitAllFutures → const MustAwaitAllFuturesAnnotation
mustAwaitAllFuturesOrError → const MustAwaitAllFuturesOrErrorAnnotation
mustBeAnonymous → const MustBeAnonymousAnnotation
mustBeAnonymousOrError → const MustBeAnonymousOrErrorAnnotation
mustBeStrongRef → const MustBeStrongRefAnnotation
mustBeStrongRefOrError → const MustBeStrongRefOrErrorAnnotation
mustHandleReturn → const MustHandleReturnAnnotation
mustHandleReturnOrError → const MustHandleReturnOrErrorAnnotation
noFutures → const NoFuturesAnnotation
noFuturesOrError → const NoFuturesOrErrorAnnotation
NONE_UNIT → const None<Unit>
OK_UNIT → const Ok<Unit>
sendable → const SendableAnnotation
Marks a parameter whose value must be sendable through SendPort. Function arguments must be a top-level function or a static method reference — closures and instance-method tear-offs are rejected because Dart's isolate runtime cannot copy them.
sendableOrError → const SendableOrErrorAnnotation
Like @sendable but the lint fires as an error rather than a warning.
SOME_UNIT → const Some<Unit>
UNIT → const Unit
unsafe → const UnsafeAnnotation
unsafeOrError → const UnsafeOrErrorAnnotation
vmInt64Bound → const double
2^63 — one past the maximum signed 64-bit integer. The VM's int is a true int64, so this is the (positive-side) bound. Negative-side bound is -2^63 and is in range, hence the asymmetric comparison in letIntOrNull.

Properties

consecList FutureOr<R> Function<R>(Iterable<FutureOr> items, _TSyncOrAsyncMapper<Iterable, R> callback, {bool eagerError = true, _TOnCompleteCallback? onComplete, _TOnErrorCallback? onError})
final
isJsRuntime bool
True when running on the JS runtime (Flutter web / dart2js / dartdevc).
final

Functions

asyncNone<T extends Object>() Async<None<T>>
asyncSome<T extends Object>(FutureOr<T> value) Async<Some<T>>
asyncUnit() Async<Unit>
combineAsync<T extends Object>(Iterable<Async<T>> asyncs, {Err<List<T>> onErr(List<Result<T>> allResults)?}) Async<List<T>>
Combines an iterable of Asyncs into one containing a list of their values.
combineOption<T extends Object>(Iterable<Option<T>> options) Option<List<T>>
Combines an iterable of Options into one containing a list of their values.
combineOutcome<T extends Object>(Iterable<Outcome<T>> outcomes, {Err<List<Option<T>>> onErr(List<Result<Option<T>>> allResults)?}) Resolvable<List<Option<T>>>
Combines an iterable of Outcomes into one containing a list of their values.
combineResolvable<T extends Object>(Iterable<Resolvable<T>> resolvables, {Err<List<T>> onErr(List<Result<T>> allResults)?}) Resolvable<List<T>>
Combines an iterable of Resolvables into one containing a list of their values.
combineResult<T extends Object>(Iterable<Result<T>> results, {Err<List<T>> onErr(List<Result<T>> allResults)?}) Result<List<T>>
Combines an iterable of Results into one containing a list of their values.
combineSync<T extends Object>(Iterable<Sync<T>> syncs, {Err<List<T>> onErr(List<Result<T>> allResults)?}) Sync<List<T>>
Combines an iterable of Syncs into one containing a list of their values.
consec<A, R>(FutureOr<A> a, FutureOr<R> callback(A a), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps a synchronous or asynchronous value to a single value.
consec2<A, B, R>(FutureOr<A> a, FutureOr<B> b, FutureOr<R> callback(A a, B b), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps two synchronous or asynchronous values to a single value.
consec3<A, B, C, R>(FutureOr<A> a, FutureOr<B> b, FutureOr<C> c, FutureOr<R> callback(A a, B b, C c), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps three synchronous or asynchronous values to a single value.
consec4<A, B, C, D, R>(FutureOr<A> a, FutureOr<B> b, FutureOr<C> c, FutureOr<D> d, FutureOr<R> callback(A a, B b, C c, D d), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps four synchronous or asynchronous values to a single value.
consec5<A, B, C, D, E, R>(FutureOr<A> a, FutureOr<B> b, FutureOr<C> c, FutureOr<D> d, FutureOr<E> e, FutureOr<R> callback(A a, B b, C c, D d, E e), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps five synchronous or asynchronous values to a single value.
consec6<A, B, C, D, E, F, R>(FutureOr<A> a, FutureOr<B> b, FutureOr<C> c, FutureOr<D> d, FutureOr<E> e, FutureOr<F> f, FutureOr<R> callback(A a, B b, C c, D d, E e, F f), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps six synchronous or asynchronous values to a single value.
consec7<A, B, C, D, E, F, G, R>(FutureOr<A> a, FutureOr<B> b, FutureOr<C> c, FutureOr<D> d, FutureOr<E> e, FutureOr<F> f, FutureOr<G> g, FutureOr<R> callback(A a, B b, C c, D d, E e, F f, G g), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps seven synchronous or asynchronous values to a single value.
consec8<A, B, C, D, E, F, G, H, R>(FutureOr<A> a, FutureOr<B> b, FutureOr<C> c, FutureOr<D> d, FutureOr<E> e, FutureOr<F> f, FutureOr<G> g, FutureOr<H> h, FutureOr<R> callback(A a, B b, C c, D d, E e, F f, G g, H h), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps eight synchronous or asynchronous values to a single value.
consec9<A, B, C, D, E, F, G, H, I, R>(FutureOr<A> a, FutureOr<B> b, FutureOr<C> c, FutureOr<D> d, FutureOr<E> e, FutureOr<F> f, FutureOr<G> g, FutureOr<H> h, FutureOr<I> i, FutureOr<R> callback(A a, B b, C c, D d, E e, F f, G g, H h, I i), {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Maps nine synchronous or asynchronous values to a single value.
decodeJsonbStrings(dynamic input, {int maxDepth = defaultDecodeJsonbStringsMaxDepth}) → dynamic
Recursively walks input and decodes any String value that begins with { or [ as JSON, replacing it with the decoded Map or List.
isNullable<T>() bool
Returns true if T is nullable.
isSubtype<TChild, TParent>() bool
Returns true if A is a subtype of B.
jsonDecodeOrNone<T extends Object>(dynamic input) Option<T>
Parses a JSON input into an object of type T, returning None on failure.
jsonDecodeOrNull<T>(String input) → T?
Parses a JSON input into an object of type T, returning Null on failure.
letAsOrNone<T extends Object>(dynamic input) Option<T>
Casts input to type T, returning None on failure.
letAsOrNull<T>(dynamic input) → T?
Casts input to type T, returning Null on failure.
letAsStringOrNone(dynamic input) Option<String>
Converts input to String, returning None on failure.
letAsStringOrNull(dynamic input) String?
Converts input to String, returning Null on failure.
letBoolOrNone(dynamic input) Option<bool>
Converts input to bool, returning None on failure.
letBoolOrNull(dynamic input) bool?
Converts input to bool, returning Null on failure.
letDateTimeOrNone(dynamic input) Option<DateTime>
Converts input to bool, returning None on failure.
letDateTimeOrNull(dynamic input) DateTime?
Converts input to bool, returning Null on failure.
letDoubleOrNone(dynamic input) Option<double>
Converts input to double, returning None on failure.
letDoubleOrNull(dynamic input) double?
Converts input to double, returning Null on failure.
letIntOrNone(dynamic input) Option<int>
Converts input to int, returning None on failure.
letIntOrNull(dynamic input) int?
Converts input to int, returning Null on failure.
letIterableOrNone<T extends Object>(dynamic input) Option<Iterable<Option<T>>>
Converts input to Iterable<Option<T>>, returning None on failure.
letIterableOrNull<T>(dynamic input) Iterable<T?>?
Converts input to Iterable<Option<T>>, returning Null on failure.
letListOrNone<T extends Object>(dynamic input) Option<List<Option<T>>>
Supported types:
letListOrNull<T>(dynamic input) List<T?>?
Converts input to List<Option<T>>, returning Null on failure.
letMapOrNone<K extends Object, V extends Object>(dynamic input) Option<Map<K, Option<V>>>
Converts input to Map<K, Option<V>>, returning None on failure.
letMapOrNull<K, V>(dynamic input) Map<K, V>?
Converts input to Map<K, Option<V>>, returning Null on failure.
letNumOrNone(dynamic input) Option<num>
Converts input to num, returning None on failure.
letNumOrNull(dynamic input) num?
Converts input to num, returning Null on failure.
letOrNone<T extends Object>(dynamic input) Option<T>
Attempts to convert a dynamic input to the specified type T, returning None on failure.
letOrNull<T>(dynamic input) → T?
Attempts to convert a dynamic input to the specified type T, returning Null on failure.
letSetOrNone<T extends Object>(dynamic input) Option<Set<Option<T>>>
Supported types:
letSetOrNull<T>(dynamic input) Set<T?>?
Converts input to Set<Option<T>>, returning Null on failure.
letUriOrNone(dynamic input) Option<Uri>
Converts input to Uri, returning None on failure.
letUriOrNull(dynamic input) Uri?
Converts input to Uri, returning Null on failure.
resolvableNone<T extends Object>() Resolvable<None<T>>
resolvableSome<T extends Object>(T value) Resolvable<Some<T>>
resolvableUnit() Resolvable<Unit>
syncNone<T extends Object>() Sync<None<T>>
syncSome<T extends Object>(T value) Sync<Some<T>>
syncUnit() Sync<Unit>
typeEquality<T1, T2>() bool
Returns true if T1 and T2 are the same type.
UNSAFE<T>(T block()) → T
Executes a block of code that is considered UNSAFE, allowing the use of methods like Outcome.unwrap. This function provides no actual safety guarantees; it only serves as a marker for the must_use_unsafe_wrapper / _or_error lint and as a signal to developers that the contained code can throw.
wait<R>(Iterable<FutureOr> items, _TSyncOrAsyncMapper<Iterable, R> callback, {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Waits for a list of FutureOr values and transforms the results.
waitAlike<T>(Iterable<FutureOr<T>> items, {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<Iterable<T>>
Waits for a list of FutureOr values and returns them as an Iterable.
waitAlikeF<T>(Iterable<_TFactory> itemFactories, {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<Iterable<T>>
Executes deferred operations and returns the results as an Iterable.
waitF<R>(Iterable<_TFactory> itemFactories, _TSyncOrAsyncMapper<Iterable, R> callback, {_TOnErrorCallback? onError, bool eagerError = true, _TOnCompleteCallback? onComplete}) FutureOr<R>
Waits for a list of FutureOr values and transforms the results.

Typedefs

LazyConstructor<T extends Object> = Resolvable<T> Function()
MapOptionPartition<K, V extends Object> = ({List<K> noneKeys, Map<K, V> someParts})
The result of partitioning a Map<K, Option<V>>.
MapResultPartition<K, V extends Object> = ({Map<K, Err<V>> errParts, Map<K, V> okParts})
The result of partitioning a Map<K, Result<V>>.
OptionPartition<T extends Object> = ({Iterable<None<T>> noneParts, Iterable<Some<T>> someParts})
The result of partitioning an Iterable<Option<T>>.
ResolvablePartition<T extends Object> = ({Iterable<Async<T>> asyncParts, Iterable<Sync<T>> syncParts})
The result of partitioning an Iterable<Resolvable<T>>.
ResultPartition<T extends Object> = ({Iterable<Err<T>> errParts, Iterable<Ok<T>> okParts})
The result of partitioning an Iterable<Result<T>>.
TAsyncAsync<T extends Object> = Async<Async<T>>
Represents a nested Async.
TAsyncErr<T extends Object> = Async<Err<T>>
Represents an Async that contains an Err.
TAsyncNone<T extends Object> = Async<None<T>>
Represents an Async that contains a None.
TAsyncOk<T extends Object> = Async<Ok<T>>
Represents an Async that contains an Ok.
TAsyncOption<T extends Object> = Async<Option<T>>
Represents an Async that contains an Option.
TAsyncResolvable<T extends Object> = Async<Resolvable<T>>
Represents an Async that contains a Resolvable.
TAsyncResult<T extends Object> = Async<Result<T>>
Represents an Async that contains a Result.
TAsyncSome<T extends Object> = Async<Some<T>>
Represents an Async that contains a Some.
TAsyncSync<T extends Object> = Async<Sync<T>>
Represents an Async that contains a Sync.
TErrAsync<T extends Object> = Err<Async<T>>
Represents an Err that contains an Async.
TErrErr<T extends Object> = Err<Err<T>>
Represents a nested Err.
TErrNone<T extends Object> = Err<None<T>>
Represents an Err that contains a None.
TErrOk<T extends Object> = Err<Ok<T>>
Represents an Err that contains an Ok.
TErrOption<T extends Object> = Err<Option<T>>
Represents an Err that contains an Option.
TErrResolvable<T extends Object> = Err<Resolvable<T>>
Represents an Err that contains a Resolvable.
TErrResult<T extends Object> = Err<Result<T>>
Represents an Err that contains a Result.
TErrSome<T extends Object> = Err<Some<T>>
Represents an Err that contains a Some.
TErrSync<T extends Object> = Err<Sync<T>>
Represents an Err that contains a Sync.
TOkAsync<T extends Object> = Ok<Async<T>>
Represents an Ok that contains an Async.
TOkErr<T extends Object> = Ok<Err<T>>
Represents an Ok that contains an Err.
TOkNone<T extends Object> = Ok<None<T>>
Represents an Ok that contains a None.
TOkOk<T extends Object> = Ok<Ok<T>>
Represents a nested Ok.
TOkOption<T extends Object> = Ok<Option<T>>
Represents an Ok that contains an Option.
TOkResolvable<T extends Object> = Ok<Resolvable<T>>
Represents an Ok that contains a Resolvable.
TOkResult<T extends Object> = Ok<Result<T>>
Represents an Ok that contains a Result.
TOkSome<T extends Object> = Ok<Some<T>>
Represents an Ok that contains a Some.
TOkSync<T extends Object> = Ok<Sync<T>>
Represents an Ok that contains a Sync.
TOnErrorCallback<T extends Object> = Err<T> Function(Object? error, StackTrace stackTrace)
TOnTaskConpletedCallback<T extends Object> = Resolvable<Unit> Function(Task<T> task, double executionProgress)
TOnTaskError = Resolvable<Object> Function(Err<Object> err)
A function that handles an error from a previous task as a side-effect.
TOptionAsync<T extends Object> = Option<Async<T>>
Represents an Option that contains an Async.
TOptionErr<T extends Object> = Option<Err<T>>
Represents an Option that contains an Err.
TOptionNone<T extends Object> = Option<None<T>>
Represents an Option that contains a None.
TOptionOk<T extends Object> = Option<Ok<T>>
Represents an Option that contains an Ok.
TOptionOption<T extends Object> = Option<Option<T>>
Represents a nested Option.
TOptionResolvable<T extends Object> = Option<Resolvable<T>>
Represents an Option that contains a Resolvable.
TOptionResult<T extends Object> = Option<Result<T>>
Represents an Option that contains a Result.
TOptionSome<T extends Object> = Option<Some<T>>
Represents an Option that contains a Some.
TOptionSync<T extends Object> = Option<Sync<T>>
Represents an Option that contains a Sync.
TResolvableErr<T extends Object> = Resolvable<Err<T>>
Represents a Resolvable that contains an Err.
TResolvableNone<T extends Object> = Resolvable<None<T>>
Represents a Resolvable that contains a None.
TResolvableOk<T extends Object> = Resolvable<Ok<T>>
Represents a Resolvable that contains an Ok.
TResolvableOption<T extends Object> = Resolvable<Option<T>>
Represents a Resolvable that contains an Option.
TResolvableResolvable<T extends Object> = Resolvable<Resolvable<T>>
Represents a nested Resolvable.
TResolvableResult<T extends Object> = Resolvable<Result<T>>
Represents a Resolvable that contains a Result.
TResolvableSome<T extends Object> = Resolvable<Some<T>>
Represents a Resolvable that contains a Some.
TResultAsync<T extends Object> = Result<Async<T>>
Represents a Result that contains an Async.
TResultErr<T extends Object> = Result<Err<T>>
Represents a Result that contains an Err.
TResultNone<T extends Object> = Result<None<T>>
Represents a Result that contains a None.
TResultOk<T extends Object> = Result<Ok<T>>
Represents a Result that contains an Ok.
TResultOption<T extends Object> = Result<Option<T>>
Represents a Result that contains an Option.
TResultResolvable<T extends Object> = Result<Resolvable<T>>
Represents a Result that contains a Resolvable.
TResultResult<T extends Object> = Result<Result<T>>
Represents a nested Result.
TResultSome<T extends Object> = Result<Some<T>>
Represents a Result that contains a Some.
TResultStream<T extends Object> = Stream<Result<T>>
TResultSync<T extends Object> = Result<Sync<T>>
Represents a Result that contains a Sync.
TServiceResolvables<TParams> = List<Resolvable<Unit> Function(TParams data)>
List of listeners returned by the provideX hooks. Each listener receives data of type TParams (typically Unit) and returns a Resolvable<Unit>.
TSomeAsync<T extends Object> = Some<Async<T>>
Represents a Some that contains an Async.
TSomeErr<T extends Object> = Some<Err<T>>
Represents a Some that contains an Err.
TSomeNone<T extends Object> = Some<None<T>>
Represents a Some that contains a None.
TSomeOk<T extends Object> = Some<Ok<T>>
Represents a Some that contains an Ok.
TSomeOption<T extends Object> = Some<Option<T>>
Represents a Some that contains an Option.
TSomeResolvable<T extends Object> = Some<Resolvable<T>>
Represents a Some that contains a Resolvable.
TSomeResult<T extends Object> = Some<Result<T>>
Represents a Some that contains a Result.
TSomeSome<T extends Object> = Some<Some<T>>
Represents a nested Some.
TSomeSync<T extends Object> = Some<Sync<T>>
Represents a Some that contains a Sync.
TSyncAsync<T extends Object> = Sync<Async<T>>
Represents a Sync that contains an Async.
TSyncErr<T extends Object> = Sync<Err<T>>
Represents a Sync that contains an Err.
TSyncNone<T extends Object> = Sync<None<T>>
Represents a Sync that contains a None.
TSyncOk<T extends Object> = Sync<Ok<T>>
Represents a Sync that contains an Ok.
TSyncOption<T extends Object> = Sync<Option<T>>
Represents a Sync that contains an Option.
TSyncResolvable<T extends Object> = Sync<Resolvable<T>>
Represents a Sync that contains a Resolvable.
TSyncResult<T extends Object> = Sync<Result<T>>
Represents a Sync that contains a Result.
TSyncSome<T extends Object> = Sync<Some<T>>
Represents a Sync that contains a Some.
TSyncSync<T extends Object> = Sync<Sync<T>>
Represents a nested Sync.
TTaskHandler<T extends Object> = TResolvableOption<T> Function(TResultOption<T> previous)
A function that defines a step in a task sequence. It receives the result of the previous task.
TVoidCallback = void Function()

Exceptions / Errors

Err<T extends Object>
A Outcome that represents the failure case of a Result, containing an error value.