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 invoations.
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.
StringUtil
String utilities.
Trio<F, S, T>
Represents a tuple of objects. It is useful for implementing a function returning a trio of objects.
XmlUtil
XML Utilities.

Extensions

DateTimeComparator on DateTime
Extension for DateTime supporting <, > ...

Constants

black → const Color
The white color
white → const Color
The black color

Properties

$whitespaces Set<int>
A set of whitespaces in code units.
final
regexWhitespaces RegExp
A regular expression to match a whitespace.
final

Functions

addMimeType(String extension, String mimeType) → void
Adds additonal mime type for the given extension. Note: it overrides the system default if any.
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, {List<int>? headerBytes, bool? isExtension, bool autoUtf8 = true}) String?
Retrieves the mime type from the given path and, optional, header bytes (headerBytes). It returns null if not fund.
isHttpStatusOK(int? status) bool
Tests whether the status code is a successfully response.
validateMimeTypes() List<String>
Validates and returns redundancy in mime additional map. It is used only for debugging purpose.

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.