_common
library
Classes
AsciiCodec
An AsciiCodec allows encoding strings as ASCII bytes
and decoding ASCII bytes to strings.
AsciiDecoder
Converts ASCII bytes to string.
AsciiEncoder
Converts strings of only ASCII characters to bytes.
Base64Codec
A base64 encoder and decoder.
Base64Decoder
Decoder for base64 encoded data.
Base64Encoder
Base64 and base64url encoding converter.
BoolList
A space-efficient list of boolean values.
ByteConversionSink
The ByteConversionSink provides an interface for converters to
efficiently transmit byte data.
CanonicalizedMap <C , K , V >
A map whose keys are converted to canonical values of type C.
CaseInsensitiveEquality
String equality that's insensitive to differences in ASCII case.
ChunkedConversionSink <T >
A ChunkedConversionSink is used to transmit data more efficiently between
two converters during chunked conversions.
ClosableStringSink
A ClosableStringSink extends the StringSink interface by adding a
close method.
Codec <S , T >
A Codec encodes and (if supported) decodes data.
CollectionStyle
An enum of collection styles.
CombinedIterableView <T >
A view of several iterables combined sequentially into a single iterable.
CombinedListView <T >
A view of several lists combined into a single list.
CombinedMapView <K , V >
Returns a new map that represents maps flattened into a single map.
Config <TConfigRef extends ConfigRef >
A configuration class, used to map strings to values.
ConfigFileRef
A reference to a config file.
ConfigManager <TConfig extends Config <ConfigRef > >
ConfigRef <TRef , TType >
A reference to a config element.
Context
An instantiable class for manipulating paths. Unlike the top-level
functions, this lets you explicitly select what platform the paths will use.
Converter <S , T >
A Converter converts data from one representation into another.
ConvertStringToDuration
A tool to convert a string to a Duration .
CsvUtility
DateTimeUtility
DeepCollectionEquality
Deep equality on collections.
DefaultEquality <E >
Equality of objects that compares only the natural equality of the objects.
DelegatingIterable <E >
An Iterable that delegates all operations to a base iterable.
DelegatingList <E >
A List that delegates all operations to a base list.
DelegatingMap <K , V >
A Map that delegates all operations to a base map.
DelegatingQueue <E >
A Queue that delegates all operations to a base queue.
DelegatingSet <E >
A Set that delegates all operations to a base set.
Encoding
Open-ended set of encodings.
Equality <E >
A generic equality relation on objects.
EqualityBy <E , F >
Equality of objects based on derived values.
EqualityMap <K , V >
A Map whose key equality is determined by an Equality object.
EqualitySet <E >
A Set whose key equality is determined by an Equality object.
Equatable
A base class to facilitate operator == and hashCode overrides.
EquatableConfig
The default configuration for all Equatable instances.
FileConfig
FileConfigManager
HeapPriorityQueue <E >
Heap based priority queue.
HtmlEscape
Converter which escapes characters with special meaning in HTML.
HtmlEscapeMode
HTML escape modes.
IdentityEquality <E >
Equality of objects that compares only the identity of the objects.
Immutable
Used to annotate a class.
IterableEquality <E >
Equality on iterables.
IterableZip <T >
Iterable that iterates over lists of values from other iterables.
JsonCodec
A JsonCodec encodes JSON objects to strings and decodes strings to
JSON objects.
JsonDecoder
This class parses JSON strings and builds the corresponding objects.
JsonEncoder
This class converts JSON objects to strings.
JsonUtf8Encoder
Encoder that encodes a single object as a UTF-8 encoded JSON string.
JsonUtility
Latin1Codec
A Latin1Codec encodes strings to ISO Latin-1 (aka ISO-8859-1) bytes
and decodes Latin-1 bytes to strings.
Latin1Decoder
This class converts Latin-1 bytes (lists of unsigned 8-bit integers)
to a string.
Latin1Encoder
This class converts strings of only ISO Latin-1 characters to bytes.
LineSplitter
A StreamTransformer that splits a String into individual lines.
ListEquality <E >
Equality on lists.
ListSlice <E >
A list view of a range of another list.
MapEquality <K , V >
Equality on maps.
MapKeySet <E >
An unmodifiable Set view of the keys of a Map .
MapValueSet <K , V >
Creates a modifiable Set view of the values of a Map .
MultiEquality <E >
Combines several equalities into a single equality.
NonGrowableListMixin <E >
Mixin class that implements a throwing version of all list operations that
change the List's length.
NonGrowableListView <E >
A fixed-length list.
OperationWaiter <T >
PathMap <V >
A map whose keys are paths, compared using p.equals and p.hash .
PathSet
A set containing paths, compared using p.equals and p.hash .
PatternSettings
PrimaryPatternSettings
PriorityQueue <E >
A priority queue is a priority based work-list of elements.
QueueList <E >
A class that efficiently implements both Queue and List .
RecordUse
Annotates a static method to be recorded.
Required
Used to annotate a named parameter p in a method or function f.
ScalarStyle
An enum of source scalar styles.
SecondaryPatternSettings
SetEquality <E >
Equality of sets.
StreamUtility
StringConversionSink
A sink for converters to efficiently transmit String data.
Style
An enum type describing a "flavor" of path.
TagDirective
A directive describing a custom tag handle.
TranslationFileReader
Provides a way to easily read translation files.
TranslationManager
UnionSet <E >
A single set that provides a view of the union over a set of sets.
UnionSetController <E >
A controller that exposes a view of the union of a collection of sets.
UnmodifiableListView <E >
An unmodifiable List view of another List.
UnmodifiableMapMixin <K , V >
Mixin class that implements a throwing version of all map operations that
change the Map.
UnmodifiableMapView <K , V >
View of a Map that disallow modifying the map.
UnmodifiableSetMixin <E >
Mixin class that implements a throwing version of all set operations that
change the Set.
UnmodifiableSetView <E >
An unmodifiable set.
UnorderedIterableEquality <E >
Equality of the elements of two iterables without considering order.
UseResult
See useResult for more details.
Utf8Codec
A Utf8Codec encodes strings to utf-8 code units (bytes) and decodes
UTF-8 code units to strings.
Utf8Decoder
This class converts UTF-8 code units (lists of unsigned 8-bit integers)
to a string.
Utf8Encoder
This class converts strings to their UTF-8 code units (a list of
unsigned 8-bit integers).
VersionDirective
A directive indicating which version of YAML a document was written to.
YamlDocument
A YAML document, complete with metadata.
YamlList
A read-only List parsed from YAML.
YamlMap
A read-only Map parsed from YAML.
YamlNode
An interface for parsed nodes from a YAML source tree.
YamlScalar
A wrapped scalar value parsed from YAML.
Extensions
CaseConversionsOnStringExt
on String
CfOnStringX
on String
ChunkedOnIterableX
on Iterable <T >
ComparatorExtension
on Comparator <T >
Extensions on comparator functions.
ConvertOnStringCaseTypeExtension
on StringCaseType
ForceObjToStringOnObjectExt
on Object
An extension method for conveniently calling forceObjToString .
GenericTypeOnIterableX
on Iterable <T >
GenericTypeOnMapX
on Map <K , V >
IterableComparableExtension
on Iterable <T >
Extensions that apply to iterables of Comparable elements.
IterableDoubleExtension
on Iterable <double >
Extension on iterables of double.
IterableExtension
on Iterable <T >
Extensions that apply to all iterables.
IterableIntegerExtension
on Iterable <int >
Extension on iterables of integers.
IterableIterableExtension
on Iterable <Iterable <T > >
Extensions on iterables whose elements are also iterables.
IterableNullableExtension
on Iterable <T? >
Extensions that apply to iterables with a nullable element type.
IterableNumberExtension
on Iterable <num >
Extensions that apply to iterables of numbers.
JoinWithLastSeparatorOnIterableX
on Iterable
ListComparableExtensions
on List <E >
Various extensions on lists of comparable elements.
ListExtensions
on List <E >
Various extensions on lists of arbitrary elements.
MapKeysAndValyesOnMapX
on Map <K1 , V1 >
MapWithDefaultOnMapX
on Map <K , V >
MaybeAddToIterableX
on Iterable <T >
MaybeAddToListX
on List <T >
MaybeAddToMapX
on Map <T1 , T2 >
MaybeAddToSetX
on Set <T >
NonNullKeysOnMapX
on Map <K? , V >
NonNullsOnMapX
on Map <K? , V? >
NonNullValuesOnMapX
on Map <K , V? >
NullIfEmptyOnIterableX
on Iterable <T >
NullIfEmptyOnListX
on List <T >
NullIfEmptyOnMapX
on Map <T1 , T2 >
NullIfEmptyOnQueueX
on Queue <T >
NullIfEmptyOnSetX
on Set <T >
PowersetOnIterableX
on Iterable <Iterable <T > >
SafeToStringOnObjectX
on Object
SetNestedValueOnMapX
on Map
StringExt1
on String
TakeLastOnIterableX
on Iterable <String >
ToMapOnIterableX
on Iterable <MapEntry <K , V > >
TraverseMapOnMapX
on Map <K , V >
TrOnStringX
on String
TryMergeOnIterableX
on Iterable <Iterable <T > ? >
TryOrNullOnFunctionExtension
on Function
TryReduceOnIterableX
on Iterable <T >
UniqueOnIterableX
on Iterable <T >
UniqueOnMapEntryIterableX
on Iterable <MapEntry <K , V > >
UnmodifiableOnListX
on List <T >
UnmodifiableOnMapX
on Map <K , V >
UnmodifiableOnSetX
on Set <T >
ValueOfOnEnumExtension
on Iterable <T >
Constants
alwaysThrows
→ const _AlwaysThrows
Used to annotate a function f. Indicates that f always throws an
exception. Any functions that override f, in class inheritance, are also
expected to conform to this contract.
ascii
→ const AsciiCodec
An instance of the default implementation of the AsciiCodec .
awaitNotRequired
→ const _AwaitNotRequired
Used to annotate a Future -returning function (including constructors,
getters, methods, and operators), or a Future -typed field (including
top-level, instance, and static) f. Indicates that the Future value that
f returns does not need to be awaited. Any methods that override f in
class inheritance, are also expected to conform to this contract.
base64
→ const Base64Codec
A base64 encoder and decoder.
base64Url
→ const Base64Codec
A base64url encoder and decoder.
CAMEL_CASE
→ const String
A key representing camel case.
CAPITALIZED_KEBAB_CASE
→ const String
A key representing lower kebab case.
checked
→ const _Checked
Used to annotate a parameter of an instance method that overrides another
method.
doNotStore
→ const _DoNotStore
Used to annotate a method, getter, top-level function, or top-level getter
to indicate that the value obtained by invoking it should not be stored in a
field or top-level variable. The annotation can also be applied to a class
to implicitly annotate all of the valid members of the class, or applied to
a library to annotate all of the valid members of the library, including
classes. If a value returned by an element marked as doNotStore is
returned from a function or getter, that function or getter should be
similarly annotated.
doNotSubmit
→ const _DoNotSubmit
Used to annotate an optional parameter, method, getter or top-level getter
or function that is not intended to be accessed in checked-in code, but
might be ephemerally used during development or local testing.
experimental
→ const _Experimental
Used to annotate a library, or any declaration that is part of the public
interface of a library (such as top-level members, class members, and
function parameters) to indicate that the annotated API is experimental and
may be removed or changed at any-time without updating the version of the
containing package, despite the fact that it would otherwise be a breaking
change.
factory
→ const _Factory
Used to annotate an instance or static method m. Indicates that m must
either be abstract or must return a newly allocated object or null. In
addition, every method that either implements or overrides m is implicitly
annotated with this same annotation.
htmlEscape
→ const HtmlEscape
A String converter that converts characters to HTML entities.
immutable
→ const Immutable
Used to annotate a class C. Indicates that C and all subtypes of C
must be immutable.
internal
→ const _Internal
Used to annotate a declaration which should only be used from within the
package in which it is declared, and which should not be exposed from said
package's public API.
isTest
→ const _IsTest
Used to annotate a test framework function that runs a single test.
isTestGroup
→ const _IsTestGroup
Used to annotate a test framework function that runs a group of tests.
json
→ const JsonCodec
An instance of the default implementation of the JsonCodec .
latin1
→ const Latin1Codec
An instance of the default implementation of the Latin1Codec .
literal
→ const _Literal
Used to annotate a const constructor c. Indicates that any invocation of
the constructor must use the keyword const unless one or more of the
arguments to the constructor is not a compile-time constant.
LOWER_DOT_CASE
→ const String
A key representing lower dot case.
LOWER_KEBAB_CASE
→ const String
A key representing lower kebab case.
LOWER_SNAKE_CASE
→ const String
A key representing lower snake case.
mustBeConst
→ const _MustBeConst
Used to annotate a parameter which should be constant.
mustBeOverridden
→ const _MustBeOverridden
Used to annotate an instance member m declared on a class or mixin C.
Indicates that every concrete subclass of C must directly override m.
mustCallSuper
→ const _MustCallSuper
Used to annotate an instance member (method, getter, setter, operator, or
field) m. Indicates that every invocation of a member that overrides m
must also invoke m. In addition, every method that overrides m is
implicitly annotated with this same annotation.
nonVirtual
→ const _NonVirtual
Used to annotate an instance member (method, getter, setter, operator, or
field) m in a class C or mixin M. Indicates that m should not be
overridden in any classes that extend or mixin C or M.
optionalTypeArgs
→ const _OptionalTypeArgs
Used to annotate a class, mixin, extension, function, method, or typedef
declaration C. Indicates that any type arguments declared on C are to
be treated as optional.
PASCAL_CASE
→ const String
A key representing pascal case.
PATH_CASE
→ const String
A key representing path case.
protected
→ const _Protected
Used to annotate an instance member in a class or mixin which is meant to
be visible only within the declaring library, and to other instance members
of the class or mixin, and their subtypes.
redeclare
→ const _Redeclare
Used to annotate an instance member of an extension type that
redeclares a member from a superinterface.
reopen
→ const _Reopen
Annotation for intentionally loosening restrictions on subtyping that would
otherwise cause lint warnings to be produced by the implicit_reopen lint.
required
→ const Required
Used to annotate a named parameter p in a method or function f.
Indicates that every invocation of f must include an argument
corresponding to p, despite the fact that p would otherwise be an
optional parameter.
sealed
→ const _Sealed
Annotation marking a class as not allowed as a super-type
outside of the current package.
UNCHANGED
→ const String
A key representing an unchanged string.
This is used when no conversion is needed.
unicodeBomCharacterRune
→ const int
The Unicode Byte Order Marker (BOM) character U+FEFF.
unicodeReplacementCharacterRune
→ const int
The Unicode Replacement character U+FFFD (�).
UPPER_DOT_CASE
→ const String
A key representing upper dot case.
UPPER_KEBAB_CASE
→ const String
A key representing upper kebab case.
UPPER_SNAKE_CASE
→ const String
A key representing upper snake case.
useResult
→ const UseResult
Used to annotate a method, field, or getter within a class, mixin, or
extension, or a or top-level getter, variable or function to indicate that
the value obtained by invoking it should be used. A value is considered used
if it is assigned to a variable, passed to a function, or used as the target
of an invocation, or invoked (if the result is itself a function).
utf8
→ const Utf8Codec
An instance of the default implementation of the Utf8Codec .
virtual
→ const _Virtual
Used to annotate a field that is allowed to be overridden in Strong Mode.
visibleForOverriding
→ const _VisibleForOverriding
Used to annotate an instance member that was made public so that it could be
overridden but that is not intended to be referenced from outside the
defining library.
visibleForTesting
→ const _VisibleForTesting
Used to annotate a declaration that was made public, so that it is more
visible than otherwise necessary, to make code testable.
Functions
absolute (String part1 , [String ? part2 , String ? part3 , String ? part4 , String ? part5 , String ? part6 , String ? part7 , String ? part8 , String ? part9 , String ? part10 , String ? part11 , String ? part12 , String ? part13 , String ? part14 , String ? part15 ])
→ String
Returns a new path with the given path parts appended to current .
base64Decode (String source )
→ Uint8List
Decodes base64 or base64url encoded bytes.
base64Encode (List <int > bytes )
→ String
Encodes bytes using base64 encoding.
base64UrlEncode (List <int > bytes )
→ String
Encodes bytes using base64url encoding.
basename (String path )
→ String
Gets the part of path after the last separator.
basenameWithoutExtension (String path )
→ String
Gets the part of path after the last separator, and without any trailing
file extension.
binarySearch <E > (List <E > sortedList , E value , {int compare (E , E )? })
→ int
Returns a position of the value in sortedList, if it is there.
canonicalize (String path )
→ String
Canonicalizes path.
castAsOrNull <T > (dynamic input )
→ T?
Similar to letAsOrNull , but uses a try-catch block internally.
chunked <T > (Iterable <T > source , int chunkSize )
→ Iterable <Iterable <T > >
Splits the source into chunks of a maximum size specified by chunkSize.
combinedOrderedStringId (List <String > ids )
→ String
Generates an ordered ID from a list of unordered IDs, that can be
used to identify the list of IDs.
compareAsciiLowerCase (String a , String b )
→ int
Compares a and b lexically, converting ASCII letters to lower case.
compareAsciiLowerCaseNatural (String a , String b )
→ int
Compares strings a and b according to lower-case
natural sort ordering .
compareAsciiUpperCase (String a , String b )
→ int
Compares a and b lexically, converting ASCII letters to upper case.
compareAsciiUpperCaseNatural (String a , String b )
→ int
Compares strings a and b according to upper-case
natural sort ordering .
compareNatural (String a , String b )
→ int
Compares strings a and b according to natural sort ordering .
consec <A , R > (FutureOr <A > a , FutureOr <R > callback (A a ), {_TOnErrorCallback? onError })
→ 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 })
→ 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 })
→ 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 })
→ 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 })
→ 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 })
→ 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 })
→ 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 })
→ 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 })
→ FutureOr <R >
Maps nine synchronous or asynchronous values to a single value.
convertToStringCaseType (String value , StringCaseType ? stringCaseType )
→ String
Converts a string to a specific case type.
dirname (String path )
→ String
Gets the part of path before the last separator.
equals (String path1 , String path2 )
→ bool
Returns true if path1 points to the same location as path2, and
false otherwise.
equalsIgnoreAsciiCase (String a , String b )
→ bool
Checks if strings a and b differ only on the case of ASCII letters.
extension (String path , [int level = 1 ])
→ String
Gets the file extension of path: the portion of basename from the last
. to the end (including the . itself).
forceObjToString (Object ? obj )
→ String
Converts an object to a string, returning a fallback representation if
the object's toString() method throws an exception.
fromUri (Object ? uri )
→ String
Returns the path represented by uri, which may be a String or a Uri .
getSetDifference <T > (Set <T > before , Set <T > after )
→ Set <T >
Returns the difference between two sets.
groupBy <S , T > (Iterable <S > values , T key (S ) )
→ Map <T , List <S > >
Groups the elements in values by the value returned by key.
hash (String path )
→ int
Returns a hash code for path such that, if equals returns true for two
paths, their hash codes are the same.
hashIgnoreAsciiCase (String string )
→ int
Hash code for a string which is compatible with equalsIgnoreAsciiCase .
insertionSort <E > (List <E > elements , {int compare (E , E )?, int start = 0 , int ? end })
→ void
Sort a list between start (inclusive) and end (exclusive) using
insertion sort.
isAbsolute (String path )
→ bool
Returns true if path is an absolute path and false if it is a
relative path.
isEquatable <T > ()
→ bool
Checks if T is any of the following types, which are directly comparable
using the == operator and are passed by value:
isNullable <T > ()
→ bool
Returns true if T is nullable.
isRelative (String path )
→ bool
Returns true if path is a relative path and false if it is absolute.
On POSIX systems, absolute paths start with a / (forward slash). On
Windows, an absolute path starts with \\, or a drive letter followed by
:/ or :\.
isRootRelative (String path )
→ bool
Returns true if path is a root-relative path and false if it's not.
isSubtype <TChild , TParent > ()
→ bool
Returns true if A is a subtype of B.
isWithin (String parent , String child )
→ bool
Returns true if child is a path beneath parent, and false otherwise.
join (String part1 , [String ? part2 , String ? part3 , String ? part4 , String ? part5 , String ? part6 , String ? part7 , String ? part8 , String ? part9 , String ? part10 , String ? part11 , String ? part12 , String ? part13 , String ? part14 , String ? part15 , String ? part16 ])
→ String
Joins the given path parts into a single path using the current platform's
separator . Example:
joinAll (Iterable <String > parts )
→ String
Joins the given path parts into a single path using the current platform's
separator . Example:
jsonDecode (String source , {Object ? reviver (Object ? key , Object ? value )? })
→ dynamic
Parses the string and returns the resulting Json object.
jsonEncode (Object ? object , {Object ? toEncodable (Object ? nonEncodable )? })
→ String
Converts object to a JSON string.
lastBy <S , T > (Iterable <S > values , T key (S ) )
→ Map <T , S >
Associates the elements in values by the value returned by key.
letAsOrNull <T > (dynamic input )
→ T?
Let's you cast input to a T type if possible, or returns null if the
cast cannot be performed.
letBoolOrNull (dynamic input )
→ bool ?
Let's you convert input to a bool type if possible, or returns null if
the conversion cannot be performed.
letDateTimeOrNull (dynamic input )
→ DateTime ?
Let's you convert input to a DateTime type if possible, or returns null
if the conversion cannot be performed.
letDoubleOrNull (dynamic input )
→ double ?
Let's you convert input to a double type if possible, or returns null if
the conversion cannot be performed.
letIntOrNull (dynamic input )
→ int ?
Let's you convert input to an int type if possible, or returns null if
the conversion cannot be performed.
letIterableFromCsv (String input )
→ Iterable <String >
Let's you convert input to an Iterable of Strings if possible, or returns
null if the conversion cannot be performed.
letIterableOrNull <T > (dynamic input , {bool filterNulls = false , dynamic nullFallback })
→ Iterable <T > ?
Let's you convert input to an Iterable type if possible, or returns null
if the conversion cannot be performed.
letListOrNull <T > (dynamic input , {bool filterNulls = false , T? nullFallback })
→ List <T > ?
Let's you convert input to a List type if possible, or returns null if
the conversion cannot be performed.
letMapOrNull <K , V > (dynamic input , {bool filterNulls = false , dynamic nullFallback })
→ Map <K , V > ?
Let's you convert input to a Map type if possible, or returns null if
the conversion cannot be performed.
letNumOrNull (dynamic input )
→ num ?
Let's you convert input to a num type if possible, or returns null if
the conversion cannot be performed.
letOrNull <T > (dynamic input )
→ T?
Let's you convert input to a T type if possible, or returns null if
the conversion cannot be performed.
letSetOrNull <T > (dynamic input , {bool filterNulls = false , T? nullFallback })
→ Set <T > ?
Let's you convert input to a Set type if possible, or returns null if
the conversion cannot be performed.
letUriOrNull (dynamic input )
→ Uri ?
Let's you convert input to a Uri type if possible, or returns null if
the conversion cannot be performed.
loadYaml (String yaml , {Uri ? sourceUrl , bool recover = false , ErrorListener? errorListener })
→ dynamic
Loads a single document from a YAML string.
loadYamlDocument (String yaml , {Uri ? sourceUrl , bool recover = false , ErrorListener? errorListener })
→ YamlDocument
Loads a single document from a YAML string as a YamlDocument .
loadYamlDocuments (String yaml , {Uri ? sourceUrl })
→ List <YamlDocument >
Loads a stream of documents from a YAML string.
loadYamlNode (String yaml , {Uri ? sourceUrl , bool recover = false , ErrorListener? errorListener })
→ YamlNode
Loads a single document from a YAML string as a YamlNode .
loadYamlStream (String yaml , {Uri ? sourceUrl })
→ YamlList
Loads a stream of documents from a YAML string.
lowerBound <E > (List <E > sortedList , E value , {int compare (E , E )? })
→ int
Returns the first position in sortedList that does not compare less than
value.
mapMap <K1 , V1 , K2 , V2 > (Map <K1 , V1 > map , {K2 key (K1 , V1 )?, V2 value (K1 , V1 )? })
→ Map <K2 , V2 >
Creates a new map from map with new keys and values.
maxBy <S , T > (Iterable <S > values , T orderBy (S ), {int compare (T , T )? })
→ S?
Returns the element of values for which orderBy returns the maximum
value.
maybeAddToIterable <T > (Iterable <T > ? source , Iterable <T > ? add )
→ Iterable <T > ?
Adds add to source if both are not null.
maybeAddToList <T > (List <T > ? source , List <T > ? add )
→ List <T > ?
Adds add to source if both are not null.
maybeAddToMap <T1 , T2 > (Map <T1 , T2 > ? source , Map <T1 , T2 > ? add )
→ Map <T1 , T2 > ?
Adds add to source if both are not null.
maybeAddToSet <T > (Set <T > ? source , Set <T > ? add )
→ Set <T > ?
Adds add to source if both are not null.
mergeDataDeep (dynamic a , dynamic b , [dynamic elseFilter (dynamic )? ])
→ dynamic
Merges two data structures deeply.
mergeDataDeepIncludeCallsToJson (dynamic a , dynamic b )
→ dynamic
Merges two data structures deeply and tries to perform toJson on objects.
mergeDataDeepIncludeCallsToMap (dynamic a , dynamic b )
→ dynamic
Merges two data structures deeply and tries to perform toMap on objects.
mergeIterables (dynamic a , dynamic b )
→ Iterable
Merges two iterables into one iterable.
mergeListsSetsOrQueues (Iterable a , Iterable b )
→ Iterable
Merges two Iterables into one. Supported Iterable types are List, Set, and
Queue.
mergeMaps <K , V > (Map <K , V > map1 , Map <K , V > map2 , {V value (V , V )? })
→ Map <K , V >
Returns a new map with all key/value pairs in both map1 and map2.
mergeMapsDeep <K , V > (List <Map <K , V > > maps )
→ Map <K , V >
Merges all maps deeply.
mergeSort <E > (List <E > elements , {int start = 0 , int ? end , int compare (E , E )? })
→ void
Sorts a list between start (inclusive) and end (exclusive) using the
merge sort algorithm.
minBy <S , T > (Iterable <S > values , T orderBy (S ), {int compare (T , T )? })
→ S?
Returns the element of values for which orderBy returns the minimum
value.
normalize (String path )
→ String
Normalizes path, simplifying it by handling .., and ., and
removing redundant path separators whenever possible.
nullFilteredList <T > (Iterable input )
→ List <T >
Converts input to a List with non-null elements if T is non-null.
nullFilteredMap <K , V > (Map input )
→ Map <K , V >
Converts input to a Map with non-null keys and values if K and V are
non-null.
nullFilteredSet <T > (Iterable input )
→ Set <T >
Converts input to a Set with non-null elements if T is non-null.
nullIfEmpty <T > (T value )
→ T?
Returns null if value is empty, otherwise returns value.
powerset <T > (Iterable <Iterable <T > > source , T combinator (T a , T b ) )
→ Iterable <T >
Returns the powerset of the given source using the provided combinator.
prettyUri (Object ? uri )
→ String
Returns a terse, human-readable representation of uri.
relative (String path , {String ? from })
→ String
Attempts to convert path to an equivalent relative path from the current
directory.
reverse <E > (List <E > elements , [int start = 0 , int ? end ])
→ void
Reverses a list, or a part of a list, in-place.
rootPrefix (String path )
→ String
Returns the root of path, if it's absolute, or the empty string if it's
relative.
safeToString (Object ? obj )
→ String
setExtension (String path , String extension )
→ String
Returns path with the trailing extension set to extension.
shuffle (List elements , [int start = 0 , int ? end , Random ? random ])
→ void
Shuffles a list randomly.
split (String path )
→ List <String >
Splits path into its components using the current platform's separator .
stronglyConnectedComponents <T > (Map <T , Iterable <T > > graph )
→ List <Set <T > >
Returns the strongly connected components of graph, in topological
order.
toUri (String path )
→ Uri
Returns the URI that represents path.
transitiveClosure <T > (Map <T , Iterable <T > > graph )
→ Map <T , Set <T > >
Returns the transitive closure of graph.
traverseMap (Map map , Iterable keys , {dynamic newValue })
→ dynamic
Traverses a Map using a list of keys. If the keys do not exist, they are
created. If newValue is provided, the value at the end of the traversal is
set to newValue.
tryToJson (dynamic object )
→ dynamic
Tries to convert an object to a json map by calling its toJson method if it
exists.
tryToMap (dynamic object )
→ dynamic
Tries to convert an object to a map by calling its toMap method if it exists.
typeEquality <T1 , T2 > ()
→ bool
Returns true if T1 and T2 are the same type.
unique <T > (Iterable <T > src , [bool equals (T a , T b )? ])
→ Iterable <T >
Returns a new iterable with all duplicate elements removed.
uniqueEntries <K , V > (Iterable <MapEntry <K , V > > entries )
→ List <MapEntry <K , V > >
uniqueKeys <K , V > (Iterable <MapEntry <K , V > > entries )
→ List <MapEntry <K , V > >
uniqueValues <K , V > (Iterable <MapEntry <K , V > > entries )
→ List <MapEntry <K , V > >
wait <R > (Iterable <FutureOr > items , _TSyncOrAsyncMapper<Iterable , R > callback , {_TOnErrorCallback? onError , bool eagerError = true })
→ FutureOr <R >
waitAlike <T > (Iterable <FutureOr <T > > items , {_TOnErrorCallback? onError , bool eagerError = true })
→ FutureOr <Iterable <T > >
waitAlikeF <T > (Iterable <_TFactory > itemFactories , {_TOnErrorCallback? onError , bool eagerError = true })
→ FutureOr <Iterable <T > >
waitF <R > (Iterable <_TFactory > itemFactories , _TSyncOrAsyncMapper<Iterable , R > callback , {_TOnErrorCallback? onError , bool eagerError = true })
→ FutureOr <R >
withoutExtension (String path )
→ String
Removes a trailing extension from the last part of path.
Exceptions / Errors
JsonCyclicError
Reports that an object could not be stringified due to cyclic references.
JsonUnsupportedObjectError
Error thrown by JSON serialization if an object cannot be serialized.
PathException
An exception class that's thrown when a path operation is unable to be
computed accurately.
YamlException
An error thrown by the YAML processor.