_common
library
Classes
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 .
Constants
defaultDecodeJsonbStringsMaxDepth
→ const int
The default recursion depth for decodeJsonbStrings .
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.
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
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.
jsonDecodeOrNull <T > (String input )
→ T?
Parses a JSON input into an object of type T, returning Null on
failure.
letAsOrNull <T > (dynamic input )
→ T?
Casts input to type T, returning Null on failure.
letAsStringOrNull (dynamic input )
→ String ?
Converts input to String , returning Null on failure.
letBoolOrNull (dynamic input )
→ bool ?
Converts input to bool , returning Null on failure.
letDateTimeOrNull (dynamic input )
→ DateTime ?
Converts input to bool , returning Null on failure.
letDoubleOrNull (dynamic input )
→ double ?
Converts input to double , returning Null on failure.
letIntOrNull (dynamic input )
→ int ?
Converts input to int , returning Null on failure.
letIterableOrNull <T > (dynamic input )
→ Iterable <T? > ?
Converts input to Iterable<Option<T>>, returning Null on failure.
letListOrNull <T > (dynamic input )
→ List <T? > ?
Converts input to List<Option<T>>, returning Null on failure.
letMapOrNull <K , V > (dynamic input )
→ Map <K , V > ?
Converts input to Map<K, Option<V>>, returning Null on failure.
letNumOrNull (dynamic input )
→ num ?
Converts input to num , returning Null on failure.
letOrNull <T > (dynamic input )
→ T?
Attempts to convert a dynamic input to the specified type T, returning
Null on failure.
letSetOrNull <T > (dynamic input )
→ Set <T? > ?
Converts input to Set<Option<T>>, returning Null on failure.
letUriOrNull (dynamic input )
→ Uri ?
Converts input to Uri , returning Null on failure.
typeEquality <T1 , T2 > ()
→ bool
Returns true if T1 and T2 are the same type.
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.