sanitizers library

String sanitizers for the flutter_validators package.

Provides functions that transform or coerce strings, mirroring the sanitizers offered by validator.js.

Extensions

BlacklistX on String
Extension providing character filtering sanitizers on String.
EscapeX on String
Extension providing HTML escape sanitizers on String.
NormalizeEmailX on String
Extension providing email normalization on String.
StripLowX on String
Extension providing control-character stripping on String.
ToBooleanX on String
Extension providing boolean conversion on String.
ToNumberX on String
Extension providing numeric and date conversions on String.
TrimX on String
Extension providing trimming sanitizers on String.

Functions

blacklist(String str, String chars) String
Removes all characters that appear in chars from the string.
escape(String str) String
Replaces HTML-unsafe characters with their entity equivalents.
ltrim(String str, [String? chars]) String
Removes the given chars from the start of the string.
normalizeEmail(String str) String?
Canonicalizes an email address.
rtrim(String str, [String? chars]) String
Removes the given chars from the end of the string.
stripLow(String str, {bool keepNewLines = false}) String
Removes control characters from the string.
toBoolean(String str, {bool strict = false}) bool
Converts the string to a boolean.
toDate(String str) DateTime?
Converts the string to a DateTime.
toFloat(String str) double?
Converts the string to a double.
toInt(String str, {int? radix}) int?
Converts the string to an integer.
trim(String str, [String? chars]) String
Removes the given chars from both ends of the string.
unescape(String str) String
Converts HTML entities back into their unsafe character equivalents.
whitelist(String str, String chars) String
Removes all characters that do not appear in chars from the string.