sanitizers library

Functions

blacklist(String str, String chars) String
remove characters that appear in the blacklist.
escape(String str) String
replace <, >, &, ' and " with HTML entities
ltrim(String str, [String? chars]) String
trim characters from the left-side of the input
normalizeEmail(String email, {Map<String, bool> options = const {}}) String
canonicalize an email address.
rtrim(String str, [String? chars]) String
trim characters from the right-side of the input
stripLow(String str, {bool keepNewLines = false}) String
remove characters with a numerical value < 32 and 127.
toBoolean(String str, {bool strict = false}) bool
convert the input to a boolean.
toDate(String str) DateTime?
convert the input to a date, or null if the input is not a date
toDouble(String str) double
convert the input to a float, or NAN if the input is not a float
toFloat(String str) double
convert the input to a float, or NAN if the input is not a float
toInt(String str, {int radix = 10}) num
convert the input to an integer, or NAN if the input is not an integer
toString(Object? input) String
convert the input to a string
trim(String str, [String? chars]) String
trim characters (whitespace by default) from both sides of the input
whitelist(String str, String chars) String
remove characters that do not appear in the whitelist.