helpers/string
library
Functions
-
byteListToHexString(List<int> bytes)
→ String
-
-
byteToInt8(int b)
→ int
-
Convert a byte length int value to an int value, for example a byte of 00000010 -> 2
-
elementAt(Object list, int index)
→ dynamic
-
List Item
-
fromBase64(dynamic s)
→ String?
-
fromBase64() but safe to use on null
-
Returns a String name given an Enum Type
-
isBool(dynamic b, {List<String> allow = const ['true', 'false', '1', '0', 'yes', 'no']})
→ bool
-
Dynamic check for a boolean from a String/bool
-
isNull(dynamic value)
→ bool
-
Takes in a String/List and returns true if it is null, blank or empty
-
isNullOrEmpty(dynamic s)
→ bool
-
-
isNumeric(dynamic s)
→ bool
-
Check if a String is numeric value
-
isPercent(dynamic s)
→ bool
-
Check if a String is a percentage value
-
newId({String prefix = "auto"})
→ String
-
-
parseEmojis(String val)
→ String
-
Parses Strings containing emoiji(s) in a text syntax like
:taco: to 🌮
-
toBool(dynamic s, {List<String> allowTrue = const ['true', '1', 'yes'], List<String> allowFalse = const ['false', '0', 'no']})
→ bool?
-
-
toChar(DateTime? datetime, {String? format})
→ String?
-
Helper function for an
eval._toDate()
-
toColor(dynamic s)
→ Color?
-
Returns an int from a String if it is a numeric value
-
toDataUri(dynamic uri)
→ UriData?
-
-
toDate(String? datetime, {String? format})
→ DateTime?
-
Converts a String to a formattable DateTime object
-
toDouble(dynamic s)
→ double?
-
If a value (typically a String) is numeric return as a double
-
toEnum<T>(String? key, List<T> values)
→ T?
-
Returns an Enum given a Key [Value] pair
-
toInt(dynamic s)
→ int?
-
Returns an int from a String if it is a numeric value
-
toNum(dynamic s, {dynamic allowMalformed = true})
→ num?
-
Takes a value typically a String and if its numeric parsed will output a num
-
toStr(dynamic s)
→ String?
-
toString() but safe to use on null
-
toTitleCase(String text)
→ String
-
Returns a given String with all the first chars of each word capitalised and other chars lowercase
-
twoByteToInt16(int v1, int v2)
→ int
-
Convert two byte length int values to an int value, for example a byte of [00000001, 00000010] -> 258