StringValidations extension
Some basic String validation extensions not provider by dart
- on
Methods
-
isNullOrEmpty(
{String? valueName}) → String? -
Available on String?, provided by the StringValidations extension
isNullOrEmpty checks is the String is null or empty. Provides a basic error message that can be used. 'valueNameis required' A return value of null indicates a valid value. -
isTooLong(
{int? maxLength = 25, String? valueName}) → String? -
Available on String?, provided by the StringValidations extension
isTooShort compares the length of a string to themaxLengthto ensure it is less than themaxLength. Provides a basic error message that can be used. 'valueNamemust be less than (maxLength+ 1) characters.' A return value of null indicates a valid length. -
isTooShort(
{int minLength = 0, String? valueName}) → String? -
Available on String?, provided by the StringValidations extension
isTooShort compares the length of a string to theminLengthto ensure it is greater. Provides a basic error message that can be used. 'valueNamerequires at leastminLengthcharacters.' A return value of null indicates a valid length. -
lengthIsInRange(
{int? minLength = 0, int? maxLength = 25, String? valueName}) → String? -
Available on String?, provided by the StringValidations extension
lengthIsInRange compares the length of a string to theminLengthandmaxLengthto ensure it is between the given values. Provides a basic error message that can be used. 'valueNamemust be betweenminLengthandmaxLengthcharacters long.' A return value of null indicates a valid length.