_common
library
Classes
Async <T extends Object >
A Outcome that represents a Resolvable that holds an asynchronous Result .
AsyncImpl <T extends Object >
Chain
A chain of stack traces.
Completer <T >
A way to produce Future objects and to complete them later
with a value or error.
ConcurrentTaskBatch <T extends Object >
A task batch that executes its collection of tasks concurrently.
DateTimeUtils
A collection of static utility methods for performing aggregate calculations
on lists of DateTime objects.
Equatable
A base class to facilitate operator == and hashCode overrides.
ErrModel
Generated class for _ErrModel.
ExperimentalAnnotation1
The class that enables the @experimental1 annotation.
ExperimentalAnnotation2
The class that enables the @experimental2 annotation.
ExperimentalAnnotation3
The class that enables the @experimental3 annotation.
Frame
A single stack frame. Each frame points to a precise location in Dart code.
FutureOr <T >
A type representing values that are either Future<T> or T.
Here
A utility class for capturing the current code location (file, line,
column, member).
Immutable
Annotation on an immutable class.
JsonDecoder
This class parses JSON strings and builds the corresponding objects.
JsonEncoder
This class converts JSON objects to strings.
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 .
Queue <E >
A Queue is a collection that can be manipulated at both ends. One
can iterate over the elements of a queue through forEach or with
an Iterator .
RecordUse
Annotation on static method or class whose accesses will be recorded.
Required
Annotation on a required named parameter.
Resolvable <T extends Object >
A Outcome that represents a value which can be resolved either synchronously
Sync or asynchronously Async .
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.
SequencedTaskBatch <T extends Object >
A batch of tasks designed to be executed sequentially by a TaskSequencer .
Some <T extends Object >
A Outcome that represents an Option that contains a value .
StreamTransformer <S , T >
Transforms a Stream.
StreamUtils
A collection of static utility methods for working with Stream .
StringToDurationConverter
A utility to safely parse a string into a Duration .
Sync <T extends Object >
A Outcome that represents a Resolvable that holds a synchronous Result .
SyncImpl <T extends Object >
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.
Trace
A stack trace, comprised of a list of stack frames.
Unit
A type representing a "no value" unit, similar to void but usable in
generics.
UnparsedFrame
A frame that failed to parse.
UnsafeAnnotation
The class that enables the @unsafe annotation.
UnsafeOrErrorAnnotation
The class that enables the @unsafeOrError annotation.
UseResult
Annotation on function or property whose value must not be ignored.
Waiter <T >
Manages a collection of operations for deferred, batched execution.
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 Async s into one containing a list of their values.
combineOption <T extends Object > (Iterable <Option <T > > options )
→ Option <List <T > >
Combines an iterable of Option s 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 Outcome s 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 Resolvable s 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 Result s 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 Sync s 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.
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? > ?
Supported types:
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? > ?
Supported types:
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 linter rules and to signal to
developers that the contained code can throw exceptions from Outcome
operations.
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
ChainHandler
= void Function(dynamic error , Chain chain )
A function that handles errors in the zone wrapped by Chain.capture .
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 .
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()