swiss_knife_vm library

Classes

AsyncValue<T>
A wrapper and handler for a value that is asynchronous (from a Future).
Base64
Base-64 utils.
CachedComputation<R, T, K>
Caches a value that can be computed.
ColossusPaging
Implementation for Colossus.services DB and Nodes.
ContextualResource<T, C extends Comparable<C>>
Wraps a resource and the related context.
ContextualResourceResolver<T, C extends Comparable<C>>
Resolves a resource based into a context, like screen dimension or OS.
DataURLBase64
Represent a Data URL in Base-64
Dimension
Represents a width X height dimension.
EventStream<T>
Implements a Stream for events and additional features.
EventStreamDelegator<T>
A delegator for EventStream.
Geolocation
Represents a Geo Location in latitude and longitude.
InteractionCompleter
Tracks interactions and after a delay, without interaction, triggers onComplete.
InteractionCompleterDummy
A dummy version of InteractionCompleter.
JSONPaging
Generic representation of a paging result in JSON.
ListenerWrapper<T>
Wraps Stream listen call.
LoadController
Controls a load process.
MapDelegate<K, V>
A Map that delegates to another _map. Useful to extend Map features.
MapProperties
A Map of properties.
Math
Common mathematical functions and constants.
MimeType
Represents MIME-Type. Useful for Content-Type and file handling.
NNField<T>
A field that can't be null. If a null value is set to it, a default value will be used.
ObjectCache
A simple cache of objects, where is possible to define different instantiators for each key.
Pair<T>
Represents a pair with a and b of type T.
Parameter<A>
Parameters2<A, B>
Parameters3<A, B, C>
Parameters4<A, B, C, D>
RegExpDialect
Represents a dialect. Compiles it on construction.
ResourceContent
Represents a Resource Content
ResourceContentCache
A cache for ResourceContent.
Scale<T>
Represents a scale with minimum, maximum and length.
ScaleNum<N extends num>
Version of Scale but for num values.
SpringBootPaging
Implementation for Spring Boot.
TreeReferenceMap<K, V>
A Map that keeps keys that are in the tree of root.
UniqueCaller<R>
Ensures that a call is executed only 1 per time.

Enums

DateRangeType
Enum for types of date ranges.
DateTimeWeekDay
Represents a Week day.
Unit

Constants

oneDay → const int
oneHour → const int
oneMinute → const int
oneSecond → const int

Properties

regExpEmail RegExp
final
stringPlaceholderPattern RegExp
final

Functions

addAllToList(List list, Object? values) → void
Adds all values to list.
asListOfMap(Object? o) List<Map>?
Returns o as a List<Map>. Converts it if needed.
asListOfString(Object? o) List<String>?
Returns o as a List<String>. Converts it if needed.
asMap(Object? o) Map?
Returns o as Map. Converts it if needed.
asMapOfString(Object? o) Map<String, String>?
Returns o as a Map<String,String>. Converts it if needed.
asTreeOfKeyString(Object? tree) → dynamic
Maps tree:
averageIterable<I, R>(Iterable<num> iterable) num?
Calculate the average value of iterable.
buildStringPattern(String? pattern, Map? parameters, [List<Map?>? extraParameters]) String?
Builds a string using as place holders in the format {{key}} from parameters and extraParameters.
buildUri(String? scheme, String? host, int? port, {String? path, String? path2, String? queryString, String? fragment}) Uri
Builds an Uri with the parameters.
callAsync(int delayMs, dynamic function()) Future
Calls a function with a delayMs.
catFile(File file, [Encoding encoding = utf8]) Future<String>
Loads a file as String using encoding.
catFileBytes(File file) Future<Uint8List>
Loads a file bytes.
clipNumber<N extends num>(N? n, N min, N max, [N? def]) → N?
Clips a number n into it's limits, min and max.
copyList(List? list) List?
Copies list.
copyListString(List<String>? list) List<String>?
Copies list as a List<String>.
copyMap(Map? map) Map?
Copies map.
copyMapString(Map<String, String>? m) Map<String, String>?
Copies map as a Map<String,String>.
dataSizeFormat(int? size, {bool? decimalBase, bool? binaryBase}) String?
Formats size as a data format using binary of decimal base for sufixes.
dateFormat_YY_MM([int? time, String delimiter = '-']) String
dateFormat_YY_MM_dd([int? time, String delimiter = '-']) String
dateFormat_YYYY_MM([int? time, String delimiter = '-']) String
dateFormat_YYYY_MM_dd([int? time, String delimiter = '-']) String
dateFormat_YYYY_MM_dd_HH([int? time, String delimiter = '-']) String
dateFormat_YYYY_MM_dd_HH_mm([int? time, String delimiter = '-', String hourDelimiter = ':']) String
dateFormat_YYYY_MM_dd_HH_mm_ss([int? time, String delimiter = '-', String hourDelimiter = ':']) String
decodeQueryString(String? queryString) Map<String, String>
Decodes queryString to a Map<String,String>.
deepCatchesListValues<T>(List? list, ValueFilter filter, [List? result]) List
Catches deeply list values that matches filter.
deepCatchesMapValues<T>(Map? map, ValueFilter filter, [List? result]) List
Catches deeply map values that matches filter.
deepCatchesSetValues<T>(Set? set, ValueFilter filter, [List? result]) List
Catches deeply set values that matches filter.
deepCatchesValues<T>(Object? o, ValueFilter filter, [List? result]) List
Catches deeply values that matches filter.
deepCopy<T>(T? o, {Copier? copier}) → T?
Deeply copies o.
deepCopyList<T>(List<T>? l, {Copier? copier}) List<T>?
Deeply copies list.
deepCopyMap<K, V>(Map<K, V>? map, {Copier? copier}) Map<K, V>?
Deeply copies map.
deepHashCode(Object? o) int
Calculate a hashcode over o, iterating deeply over sub elements if is a List or Map.
deepHashCodeList(List? list) int
Computes a hash code inspecting deeply list.
deepHashCodeMap(Map? map) int
Computes a hash code inspecting deeply map.
deepReplaceListValues<T>(List? list, ValueFilter filter, ValueReplacer replacer) → void
Replaces values applying replacer to values that matches filter.
deepReplaceMapValues<T>(Map? map, ValueFilter filter, ValueReplacer replacer) → void
Replaces values applying replacer to values that matches filter.
deepReplaceSetValues<T>(Set? set, ValueFilter filter, ValueReplacer replacer) → void
Replaces values applying replacer to values that matches filter.
deepReplaceValues<T>(Object? o, ValueFilter filter, ValueReplacer replacer) Object?
Replaces values applying replacer to values that matches filter.
encodeJSON(Object? json, {String? indent, bool withIndent = false, bool clearNullEntries = false, Object? toEncodable(Object? object) = toEncodableJSON}) String
Encodes json to a JSON string.
encodeQueryString(Map<String, String>? parameters) String
Encodes parameters as a query string.
ensureNotEmptyString(String? s, {bool trim = false, String? def}) String?
If s isEmptyString will return def or null.
findKeyEntry<K, V>(Map? map, List<K>? keys, [bool ignoreCase = false]) MapEntry<K, V?>?
Finds in map a entry that has one of keys.
findKeyName<K, V>(Map? map, List<K>? keys, [bool ignoreCase = false]) → K?
Finds in map a key that has one of keys.
findKeyPathValue<V>(Map? map, String? keyPath, {String keyDelimiter = '/', bool isValidValue(Object? value)?}) → V?
Finds in map a value that is in key path keyPath
findKeyValue<K, V>(Map? map, List<K>? keys, [bool ignoreCase = false]) → V?
Finds in map a value that has one of keys.
formatDecimal(Object? value, {int precision = 2, String decimalSeparator = '.'}) String?
Formats value to a decimal value.
formatPercent(Object? percent, {int precision = 2, bool isRatio = false}) String
Formats percent as a percentage string like: 0%, 90% or 100%.
formatTimeMillis(int? time) String
getCharsetEncoding(String? charset) Encoding?
getCurrentTimeMillis() int
Returns the current time in milliseconds since epoch.
getDateAmPm([int? time]) String
getDateHour([int? time]) int
getDateTimeDayEnd([DateTime? time]) DateTime
Returns the end of the day for time.
getDateTimeDayStart([DateTime? time]) DateTime
Returns the start of the day for time.
getDateTimeEndOf(DateTime time, Object? unit, {DateTimeWeekDay? weekFirstDay, String? locale}) DateTime?
Returns the end of a time unit using time as reference.
getDateTimeLastMonth([DateTime? time]) Pair<DateTime>
Returns start and end of last month, before current month, using time as reference.
getDateTimeLastNDays(int nDays, [DateTime? time]) Pair<DateTime>
Returns start and end of last nDays counting from time.
getDateTimeLastWeek([DateTimeWeekDay? weekFirstDay, DateTime? time]) Pair<DateTime>
Returns start and end of last week, before current week, using time as reference.
getDateTimeNow() DateTime
Same as DateTime.now().
getDateTimePreviousMonth(int month, {int? year}) DateTime
Returns start of previous month, using as reference month and year.
getDateTimeRange(DateRangeType rangeType, [DateTime? time, DateTimeWeekDay? weekFirstDay]) Pair<DateTime>
Returns start and end of date range rangeType.
getDateTimeStartOf(DateTime time, Object? unit, {DateTimeWeekDay? weekFirstDay, String? locale}) DateTime?
Returns the start of a time unit using time as reference.
getDateTimeThisMonth([DateTime? time]) Pair<DateTime>
Returns start and end of this month, using time as reference.
getDateTimeThisWeek([DateTimeWeekDay? weekFirstDay, DateTime? now]) Pair<DateTime>
Returns start and end of this week using time as reference.
getDateTimeWeekDay(int? weekDayIndex) DateTimeWeekDay?
Returns enum DateTimeWeekDay by weekDayIndex (from 1 to 7). See getDateTimeWeekDayIndex.
getDateTimeWeekDay_from_ISO_8601_index(int? weekDayIndex) DateTimeWeekDay?
Returns enum DateTimeWeekDay using weekDayIndex compliant with ISO 8601.
getDateTimeWeekDayByName(String? weekDayName) DateTimeWeekDay?
Returns enum DateTimeWeekDay by week day name in english
getDateTimeWeekDayIndex(DateTimeWeekDay? weekDay) int?
Gets index of DateTimeWeekDay, starting from 1 (Monday) to 7 (Sunday), same range as DateTime.wednesday .
getDateTimeWeekEnd([DateTimeWeekDay? weekFirstDay, DateTime? now]) DateTime
Returns the end of the week using time as reference.
getDateTimeWeekStart([DateTimeWeekDay? weekFirstDay, DateTime? time]) DateTime
Returns the start of the week using time as reference.
getDateTimeYesterday([DateTime? time]) DateTime
Returns the start of yesterday from time.
getEntryIgnoreCase<V>(Map<String, V?> map, String? key) MapEntry<String, V?>?
Gets a map entry ignoring key case.
getIgnoreCase<V>(Map<String, V> map, String? key) → V?
Gets a map value ignoring key case.
getLastDayOfMonth(int month, {int? year}) int
Returns the last day of month.
getMillisecondsAsUnit(int? ms, Object? unit, [double? def]) double?
getPathExtension(String? path) String?
Returns the File extension of a path.
getPathFileName(String? path) String?
Returns the File name of a path.
getPathWithoutFileName(String? path) String?
Returns path removing File name if present.
getSetEntryInstance<T>(Set<T>? set, T? value) → T?
Returns the instance that matches value in set.
getUnitAsMilliseconds(Object? unit, [int amount = 1]) int
getUnitByIndex(int? index, [Unit? def]) Unit?
getUnitByName(String? name, [Unit? def]) Unit?
getUriBase() Uri
Returns platform base Uri. See Uri.base .
getUriBaseHost() String
The host of base Uri.
getUriBaseHostAndPort({bool suppressPort80 = true, int? port}) String
The host and port of base Uri.
getUriBasePort() int
The port of base Uri.
getUriBaseScheme() String
The scheme of base Uri.
getUriRoot() Uri
The root Uri for the platform.
getUriRootURL({bool suppressPort80 = true, int? port}) String
Returns base Uri as URL string.
getWeekFirstDay([String? locale]) DateTimeWeekDay
Returns the first day of a week as enum DateTimeWeekDay for locale.
groupIterableBy<K, V, I>(Iterable<I> iterable, MapEntry<K, V> map(I entry), V merge(K key, V value1, V value2)) Map<K, V>
Groups interable entries using map to generate a MapEntry for each entry, than uses merge to group entries of the same group (key).
hasBlankChar(String s) bool
Returns true if s has a blank character.
hasBlankCharFrom(String s, [int offset = 0]) bool
Returns true if s has a blank character from offset.
hasBlankCharInRange(String s, int offset, int length) bool
Returns true if s has a blank character in range offset+length.
isAllEquals(Object? element, Object? value, [bool deep = false]) bool
Returns true element is equals to value.
isAllEqualsInList(List? list, Object value, [bool deep = false]) bool
Returns true if list elements are all equals to value.
isAllEqualsInMap(Map? map, Object value, [bool deep = false]) bool
Returns true if map values are all equals to value.
isAlphaNumeric(int c) bool
isAlphaNumericString(String s, [int offset = 0]) bool
isAlphaNumericStringInRange(String s, int offset, int length) bool
isBlankChar(String? c) bool
Returns true if c is a blank char (space, \t, \n, \r).
isBlankCodeUnit(int c) bool
Returns true if c is a blank char code unit.
isBlankString(String s, [int offset = 0]) bool
Returns true if s has only blank characters.
isBlankStringInRange(String s, int offset, int length) bool
Returns true if s has only blank characters in range offset+length.
isBool(Object? value) bool
Returns true if value is bool. Can be a bool as string too.
isBoolList(Object? value, [String delimiter = ',']) bool
Returns true if is a list of bool. Can be a string of bool too.
isDigit(int c) bool
isDigitString(String s, [int offset = 0]) bool
isDigitStringInRange(String s, int offset, int length) bool
isDouble(Object? value) bool
Returns true if value is double. Can be a double as string too.
isDoubleList(Object? value, [String delimiter = ',']) bool
Returns true if is a list of double. Can be a string of double too.
isEmail(Object? value) bool
Returns true if value represents an e-mail address.
isEmptyObject<T>(T? o, {bool trim = false}) bool
Returns true if o is empty. Checks for String, List, Map Iterable, Set or o.toString().
isEmptyString(String? s, {bool trim = false}) bool
Returns true if s is empty or null.
isEncodedJSON(String? s) bool
Returns true if s is a encoded JSON String of a primitive value.
isEncodedJSONBoolean(String? s) bool
Returns true if s is a encoded JSON bool.
isEncodedJSONList(String? s) bool
Returns true if s is a encoded JSON List.
isEncodedJSONMap(String? s) bool
Returns true if s is a encoded JSON Map.
isEncodedJSONNull(String? s) bool
Returns true if s is a encoded JSON null.
isEncodedJSONNumber(String? s) bool
Returns true if s is a encoded JSON num.
isEncodedJSONPrimitive(String? s) bool
Returns true if s is a encoded JSON String of a primitive value.
isEncodedJSONString(String? s) bool
Returns true if s is a encoded JSON String.
isEquals(Object? o1, Object? o2, [bool deep = false]) bool
Returns true if o1 and o2 are equals.
isEqualsAsString(Object? o1, Object? o2) bool
Returns true if o1 and o2 are equals as String. Uses String.toString to check.
isEqualsDeep(Object? o1, Object? o2) bool
Returns true if o1 and o2 are equals deeply.
isEqualsIterable<T>(Iterable<T>? i1, Iterable<T>? i2) bool
Returns true if both iterable, i1 and i2, have equals entries in the same order.
isEqualsList<T>(List<T>? l1, List<T>? l2) bool
Returns true if both lists, l1 and l2, have equals entries in the same order.
isEqualsMap<K, V>(Map<K, V>? m1, Map<K, V>? m2) bool
Returns true if both maps, m1 and m2, have equals entries in the same order.
isEqualsSet<T>(Set<T>? s1, Set<T>? s2) bool
Returns true if both sets, s1 and s2, have equals entries in the same order.
isEquivalentIterator(Iterable? it1, Iterable? it2, {bool deep = false}) bool
Same as isEquivalentList but for Iterable.
isEquivalentList(List? l1, List? l2, {bool sort = false, bool deep = false}) bool
Returns true if l1 and l2 are equals, including the same position for the elements.
isEquivalentMap(Map? m1, Map? m2, {bool deep = false}) bool
Returns true if m1 and m2 are equals.
isHttpURL(dynamic value) bool
Returns true if value represents a HTTP or HTTPS URL.
isInt(Object? value) bool
Returns true if value is int. Can be a int as string too.
isIntList(Object? value, [String delimiter = ',']) bool
Returns true if is a list of int. Can be a string of int too.
isInUnixEpochRange(Object? value, [bool inMilliseconds = true]) bool
Returns true if n is in range of a Unix epoch time.
isIPAddress(String? host) bool
Returns true if is a IPv4 or IPv6 address.
isIPv4Address(String? host) bool
Returns true if is a IPv4 address.
isIPv6Address(String? host) bool
Returns true if is a IPv6 address.
isJSON(Object? value) bool
Returns true if value is a JSON.
isJSONList(Object? json) bool
Returns true if value is a JSON List.
isJSONMap(Object? json) bool
Returns true if value is a JSON Map<String,?>.
isJSONPrimitive(Object? value) bool
Returns true if value is a JSON primitive (String, bool, num, int, double, or null).
isListEntriesAllOfSameType(Iterable? list) bool
Returns true if all list elements are of the same type.
isListEntriesAllOfType(Iterable? list, Type type) bool
Returns true if all list elements are of type.
isListOfList(Object? list) bool
Returns true if list elements are all of type List.
isListOfListOfList(Object? list) bool
Returns true if list elements are all of type List<List>.
isListOfListValuesAllEquals(Iterable<List>? list, {Object? eqValue, int? eqValueIndex}) bool
Returns true if list elements are all equals to value at index valueIndex.
isListOfMap(Object? list) bool
Returns true if list elements are all of type Map.
isListOfNum(Iterable? list) bool
Returns true if list elements are all of type num.
isListOfString(Iterable? list) bool
Returns true if list elements are all of type String.
isListOfStrings(Iterable? list) bool
Returns true if list values are of type String.
isListOfType<T>(Iterable? list) bool
Returns true if list elements are all of type T.
isListOfTypes<A, B>(Iterable? list) bool
Returns true if list elements are all of type A or B.
isListValuesAllEquals(Object? list, [Object? eqValue]) bool
Returns true if list elements are all equals to value.
isListValuesIdentical(List? l1, List? l2) bool
Returns true if all list elements are identical.
isLocalhost(String? host) bool
Returns true if host is localhost (also checks for IPv4 and IPv6 addresses).
isMapOfString(Map? map) bool
Returns true if map is Map<String,String>.
isMapOfStringKeys(Map? map) bool
Returns true if map has String keys.
isMapOfStringKeysAndListValues(Map? map) bool
Returns true if map has String keys and List values.
isMapOfStringKeysAndNumValues(Map? map) bool
Returns true if map has String keys and num values.
isNegativeNumber(num? n) bool
Returns true if n < 0. If n is null returns false.
isNonBlankChar(String? c) bool
Returns ![isBlankChar].
isNotBlankCodeUnit(int c) bool
Returns ![isBlankCodeUnit].
isNotEmptyObject<T>(T? value, {bool trim = false}) bool
Returns ![isEmptyObject].
isNotEmptyString(String? s, {bool trim = false}) bool
Returns ![isEmptyString].
isNum(Object? value) bool
Returns true if value is num. Can be a num as string too.
isNumList(Object? value, [String delimiter = ',']) bool
Returns true if is a list of num. Can be a string of num too.
isPositiveNumber(num? n) bool
Returns true if n > 0. If n is null returns false.
isUriBaseIP() bool
isUriBaseLocalhost() bool
Returns true if base Uri is localhost. See isLocalhost.
joinLists(List? l1, [List? l2, List? l3, List? l4, List? l5, List? l6, List? l7, List? l8, List? l9]) List
Joins all parameters to a single list.
listContainsAll(Iterable? list, Iterable? entries) bool
Returns true if list contains all elements of type entry.
listContainsType<T>(Iterable? list) bool
Returns true if list contains elements of type T.
listenStreamWithInteractionCompleter<T>(Stream<T> stream, Duration triggerDelay, void onData(T? event)) InteractionCompleter
Listen stream, calling onData only after triggerDelay duration.
listMatchesAll<T>(Iterable<T>? list, bool matcher(T entry)) bool
Returns true if all list elements matches matcher.
listMatchesAny<T>(Iterable<T>? list, bool matcher(T entry)) bool
Returns true if any element of list matches matcher.
listNotMatchesAll<T>(Iterable<T>? list, bool matcher(T entry)) bool
Returns true if at least ONE list element does NOT matches matcher.
maxInIterable<I, R>(Iterable<num> iterable) num?
Uses mergeIterable to find maximum value in iterable.
mergeIterable<I, R>(Iterable<I> iterable, R merge(R? total, I value), [R? init]) → R?
Merges all entries of iterable using merge function.
minInIterable<I, R>(Iterable<num> iterable) num?
Uses mergeIterable to find minimum value in iterable.
parseBool(Object? v, [bool? def]) bool?
Parses v to bool.
parseBoolsFromInlineList(Object? s, Pattern delimiter, [List<bool>? def]) List<bool>?
Parses s to a List<bool>.
parseComparable<T>(Object? v) Comparable<T>?
Parses v as to a Comparable type.
parseDateTime(Object? date, [DateTime? def]) DateTime?
Parses date as DateTime.
parseDateTimeFromInlineList(Object? o, [Pattern delimiter = ',', List<DateTime>? def]) List<DateTime>?
Converts o to a List<DateTime>.
parseDouble(Object? v, [double? def]) double?
Parses v to double.
parseDoublesFromInlineList(Object? s, [Pattern delimiter = ',', List<double>? def]) List<double>?
Parses s to a List<double>.
parseDuration(String? unit, [int amount = 0, Duration? def]) Duration?
Parses unit and amount to Duration.
parseFromInlineList<T>(String? s, Pattern delimiter, [StringMapper<T>? mapper, List<T>? def]) List<T>?
Parses s as a inline list.
parseFromInlineMap<K, V>(String? s, Pattern delimiterPairs, Pattern delimiterKeyValue, [StringMapper<K>? mapperKey, StringMapper<V>? mapperValue, Map<K, V>? def]) Map<K, V>?
Parses s as a inline Map.
parseFromInlineProperties(String s, [StringMapper<String>? mapperKey, StringMapper<String>? mapperValue, Map<String, String>? def]) Map<String, String>?
Parses an inline properties, like inline CSS, to a Map<String,String>.
parseInt(Object? v, [int? def]) int?
Parses v to int.
parseIntList(Object? l, [List<int>? def]) List<int>?
Parses l as List<int>.
parseIntsFromInlineList(Object? s, [Pattern delimiter = ',', List<int>? def]) List<int>?
Parses s to a List<int>.
parseJSON(Object? json, [Object? def]) → dynamic
Parses json to a JSON tree.
parseListOf<T, R>(Object? s, ParserFunction<T, R> parser, [List<R>? def]) List<R>?
Parses s to a List<R>, where R is the result of parse.
parseListOfList<T, R>(Object? s, ParserFunction<T, R> parser, [List<List<R>>? def]) List<List<R>>?
Parses s to a List<List<R>>, where R is the result of parse.
parseMapEntryOfStrings<K, V>(Object? e, [Pattern? delimiter, MapEntry<String, String>? def]) MapEntry<String, String>?
Parses e as a MapEntry<String, String>
parseNum(Object? v, [num? def]) num?
Parses v to num.
parseNumsFromInlineList(Object? s, [Pattern delimiter = ',', List<num>? def]) List<num>?
Parses s to a List<num>.
parseNumsFromList(List list) List<num>
Parses a generic list to a List<num>.
parsePercent(Object? v, [double? def]) num?
Parses v as a percentage from 0..100.
parsePoint(Object? value) Point<num>?
Parses value as a Point.
parsePointFromList(List? list) Point<num>?
Parses list as a Point.
parsePointFromMap(Map map) Point<num>?
Parses map as a Point.
parsePointFromString(String? s) Point<num>?
Parses s as a Point.
parseRectangle(Object? value) Rectangle<num>?
Parses value as a Rectangle.
parseRectangleFromList(List list) Rectangle<num>?
Parses list as a Rectangle.
parseRectangleFromMap(Map<String, Object>? map) Rectangle<num>?
Parses map as a Rectangle.
parseRectangleFromString(String? s) Rectangle<num>?
Parses s as a Rectangle.
parseRegExp(Object? regExp) RegExp?
Parses regExp parameter to RegExp.
parseString(Object? v, [String? def]) String?
Parses v as String.
parseStringFromInlineList(Object? s, [Pattern? delimiter, List<String>? def]) List<String>?
Parses s as inline List<String>.
parseStringFromInlineMap(Object? s, Pattern delimiterPairs, Pattern delimiterKeyValue, [Map<String, String>? def]) Map<String, String>?
Parses s as a inline Map<String,String>.
parseUnit(Object? unit, [Unit? def]) Unit?
putIgnoreCase<V>(Map<String, V> map, String key, V value) → V?
Puts a map value ignoring key case.
regExpDialect(Map<String, String> dialectWords, String pattern, {bool multiLine = false, bool caseSensitive = true}) RegExp
Builds a RegExp using a dialect of words (Map parameter dialectWords).
regExpHasMatch(Object? regExp, String s) bool
Returns true if regExp has any match at s.
regExpReplaceAll(Object? regExp, String s, String replace) String
Uses regExp to replace matches at s, substituting with replace.
regExpReplaceAllMapped(Object? regExp, String s, String replace(Match match)) String
Uses regExp to replace matches at s, substituting with replace Function results.
removeEmptyEntries(List? list) bool
Remove all entries of list that are true for isEmptyObject.
removeNullEntries<T>(T? json) → T?
Remove null entries from json tree.
removeUriFragment(String url) Uri
Removes fragment from url and returns an Uri.
removeUriQueryString(String url) Uri
Removes query string from url and returns an Uri.
replaceStringMarks(String? s, RegExp marksPattern, String markResolver(String markName)) String?
Replaces String s marks using marksPattern and markResolver.
resolveUri(String url, {String? baseURL, Uri? baseUri}) Uri
Resolves url and returns an Uri.
resolveURL(String url, {String? baseURL, Uri? baseUri}) String
Same as resolveUri, but returns Uri as URL String.
resolveValue<T>(T? value, [T? def, ValueValidator valueValidator = isNotEmptyObject]) → T?
Validates value and returns value or def.
saveFile(File file, String data, [Encoding encoding = utf8]) Future<File>
Saves a file from data string using encoding.
saveFileBytes(File file, Uint8List data) Future<File>
Saves a file from data bytes.
sortMapEntries<K, V>(Map<K, V> map, [CompareMapEntryFunction<K, V>? compare, bool reversed = false]) Map<K, V>
Returns a Map with sorted entries.
sortMapEntriesByKey<K, V>(Map<K, V?> map, [bool reversed = false]) Map<K, V?>
Returns a Map sorted by keys.
sortMapEntriesByValue<K, V>(Map<K, V> map, [bool reversed = false]) Map<K, V>
Returns a Map sorted by keys.
split(String s, Pattern delimiter, [int? limit]) List<String>
Splits s using delimiter and limit.
sumIterable<I, R>(Iterable<num> iterable, {num init = 0}) num
Uses mergeIterable to sum all iterable values.
toCamelCase(String s) String
Formats s with camel case style.
toEncodableJSON(Object? o) Object?
Ensures that o is an encodable JSON tree.
toEncodableJSONList(List? list) List
Ensures that list is an encodable JSON tree.
toEncodableJSONMap(Map? map) Map
Ensures that map is an encodable JSON tree.
toFlatListOfStrings(Object? s, {Pattern? delimiter, bool trim = true, bool ignoreEmpty = true}) List<String>
Converts s to a List<String>. Converts any collection to a flat list of strings.
toNonNullList<T>(List? list, {bool forceTypeCast = true}) List<T>
Converts list to a List<T> ignoring any null element.
toNonNullMap<K, V>(Map? map, {bool forceTypeCast = true}) Map<K, V>
Converts map to a Map<K,V> ignoring any entry with null key or null value.
toNonNullSet<T>(Set? set, {bool forceTypeCast = true}) Set<T>
Converts set to a Set<T> ignoring any null element.
toUpperCaseInitials(String s) String
Formats s with initial character to Upper case.
unquoteString(String s) String
Removes quotes from String s

Typedefs

CompareMapEntryFunction<K, V> = int Function(MapEntry<K, V> entry1, MapEntry<K, V> entry2)
Copier = T? Function<T>(T? o)
EventValidatorFunction<T> = bool Function(EventStream<T> eventStream, T event)
LoaderFunction = Future<bool> Function()
PagingFormatInstantiator = JSONPaging Function(dynamic json)
PagingFormatMatcher = bool Function(Object? json)
PagingRequester = Future<JSONPaging?> Function(int page)
A Function that performs a paging request.
ParserFunction<T, R> = R Function(T value)
StringMapper<T> = T Function(String s)
TypeTester<T> = bool Function(T value)
ValueFilter = bool Function(Object? collection, Object? key, Object? value)
ValueReplacer = Object? Function(Object? collection, Object? key, Object? value)
ValueValidator<V> = bool Function(V? value)