StringExtensions extension

on

Properties

addSpaceAndCommaIfNotEmpty String
If string is not blankisNotBlank append the string with a ', '
no setter
asBool bool
Convert this string into boolean.
no setter
isNotBlank bool
Returns true if s is neither null, empty nor is solely made of whitespace characters.
no setter
showDashIfEmpty String
Add prefix if not empty else return empty string
no setter
toDOUBLE double
Parses the string as an int or 0 defaultDouble.
no setter
toINT int
Parses the string as an int or 0 defaultInt.
no setter

Methods

addPrefixIfNotEmpty(String prefix) String
Add prefix if not empty else return empty string
toColor() Color
Parse string to Color
toDateTime({dynamic context}) DateTime?
Parse string to DateTime or Null
toList() List
JSON String to List usingjson.decode
toMap() Map
JSON String to Map usingjson.decode