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

$whitespaces → const Set<int>
A set of whitespaces in code units.
black → const Color
The white color
white → const Color
The black color

Properties

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.
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, {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.
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
Tests whether the status code is a successfully response.
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 give string. For example, backgroundColor' => background-color`.
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.