util
library
Classes
Color
An RGB based color object. The toString method returns a CSS-compatible color value.
HslColor
An HSL based color object.
HsvColor
An HSV based color object.
InvokeUtil
Utilities related to invocations.
ListUtil
List utilities.
MapUtil
A collection of Map related utilities.
MapWrapper <K , V >
A map wrapper for proxying another map.
Pair <F , S >
Represents a pair of objects.
It is useful for implementing a function returning a pair of objects.
ReplaceAll
Replaces the occurrence of the keys of replaces in text
with the corresponding value of replaces.
Trio <F , S , T >
Represents a tuple of objects.
It is useful for implementing a function returning a trio of objects.
XmlUtil
XML Utilities.
Functions
addMimeType (String extension , String mimeType )
→ void
Adds additional mime type for the given extension.
Note: it overrides the system default if any.
camelize (String name )
→ String
Camelizes the given string.
For example, background-color -> backgroundColor.
convertList <T , S > (Iterable ? json , T parse (S element ) )
→ List <T > ?
Parses the given list into a list of PODOs (plain-old-dart-object).
It returns null if json is null.
convertListNS <T , S > (Iterable ? json , T parse (S element ) )
→ List <T >
Parses the given list into a list of PODOs.
Unlike convertList , it returns an empty list if json is null
getMimeType (String ? path , {bool ? isExtension , bool autoUtf8 = true })
→ String ?
Retrieves the mime type from the given path and, optionally,
header bytes (headerBytes).
It returns null if not found.
isChar (String cc , {bool digit = false , bool upper = false , bool lower = false , bool whitespace = false , String ? match })
→ bool
Returns whether the character matches the specified conditions.
isCharCode (int cc , {bool digit = false , bool upper = false , bool lower = false , bool whitespace = false })
→ bool
Returns whether the character code matches the specified conditions.
isHttpStatusOK (int ? status )
→ bool
Whether the HTTP status code is a successful response (2xx range).
Null, redirects (3xx), informational (1xx), and error codes return false.
isWhitespace (int cc )
→ bool
Tests if the given code point (cc) is a white space.
skipWhitespaces (String str , int from )
→ int
Returns the index of the first non-whitespace character starting at from,
min(from, str.length) if not found.
uncamelize (String name )
→ String
Uncamelizes the given string.
For example, backgroundColor -> background-color.
validateMimeTypes ()
→ List <String >
Returns extensions whose value here equals package:mime's default —
pure duplicates, safe to delete. Intentional overrides (where our
value differs from the SDK) are excluded. For debugging only.
Typedefs
AsBool
= bool Function()
A function that returns a bool.
AsDouble
= double Function()
A function that returns a double.
AsInt
= int Function()
A function that returns an integer.
AsList <T >
= List <T > Function()
A function that returns a list.
AsMap <K , V >
= Map <K , V > Function()
A function that returns a map.
AsString
= String Function()
A function that returns a string.