DartValidate class Null safety

Pattern-RegExp: http://goo.gl/jxPnU3 http://www.mkyong.com/regular-expressions/how-to-validate-password-with-regular-expression/

Constructors

DartValidate()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

exclusiveBetween(Comparable start, Comparable end, Comparable value, [String message = DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE]) → void
Validate that the specified argument object fall between the two exclusive values specified; otherwise, throws an exception. [...]
inclusiveBetween(Comparable start, Comparable end, Comparable value, [String message = DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE]) → void
Validate that the specified argument object fall between the two inclusive values specified; otherwise, throws an exception. [...]
isAlphaNumeric(String input, [String message = DEFAULT_MATCHES_PATTERN_EX]) → void
isEmail(String input, [String message = DEFAULT_MATCHES_PATTERN_EX]) → void
isHex(String input, [String message = DEFAULT_MATCHES_PATTERN_EX]) → void
isInstance(instanceCheck instanceCheck, dynamic obj, [String message = DEFAULT_IS_INSTANCE_OF_EX_MESSAGE]) → void
Validate that the argument is an instance of the specified class; otherwise throwing an exception. This method is useful when validating according to an arbitrary class [...]
isJson(dynamic value, [String message = DEFAULT_JSON_MESSAGE]) → void
Validate that the specified value ist either a num, String, bool, Map or List. If the first check fails isJson checks if the value has a toJson() function - if so, the value is also valid [...]
isKeyInMap(dynamic key, Map map, [String message = DEFAULT_KEY_IN_MAP_MESSAGE]) → void
Validate that the specified key is in the map and if so the value is not null. If %key% is found in [message] it will be replaced with [key].toString() [...]
isPassword(String input, [String message = DEFAULT_MATCHES_PATTERN_EX]) → void
isTrue(bool expression, [String message = DEFAULT_IS_TRUE_EX_MESSAGE]) bool
Validate that the argument condition is [true] otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean expression, such as validating a primitive number or using your own custom validation expression. [...]
isUUID(String input, [String message = DEFAULT_MATCHES_PATTERN_EX]) → void
matchesPattern(String input, RegExp pattern, [String message = DEFAULT_MATCHES_PATTERN_EX]) → void
Validate that the specified argument character sequence matches the specified regular expression pattern; otherwise throwing an exception. [...]
noNullElements(Iterable iterable, [String message = DEFAULT_NO_NULL_ELEMENTS_ARRAY_EX_MESSAGE]) Iterable
Validate that the specified argument array is neither [null] nor contains any elements that are [null]; otherwise throwing an exception with the specified message. [...]
notBlank(String? value, [String message = DEFAULT_NOT_BLANK_EX_MESSAGE]) String?
Validate that the specified string is neither [null], a length of zero (no characters), empty nor whitespace; otherwise throwing an exception with the specified message. [...]
notEmpty(dynamic value, [String message = DEFAULT_NOT_EMPTY_MESSAGE]) → dynamic
Validate that the specified argument is neither [null] nor is empty (object must have isEmpty implemented); otherwise throwing an exception with the specified message. [...]
notNull<T>(T object, [String message = DEFAULT_IS_NULL_EX_MESSAGE]) → T
Validate that the specified argument is not [null]; otherwise throwing an exception. [...]
validIndex(Iterable iterable, int index, [String message = DEFAULT_VALID_INDEX_ARRAY_EX_MESSAGE]) Iterable
Validates that the index is within the bounds of the argument iterable; otherwise throwing an exception with the specified message. [...]
validState(bool expression, [String message = DEFAULT_VALID_STATE_EX_MESSAGE]) → void
Validate that the stateful condition is [true] otherwise throwing an exception. This method is useful when validating according to an arbitrary boolean expression, such as validating a primitive number or using your own custom validation expression. [...]

Constants

DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE → const String
"The value is not in the specified exclusive range"
DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE → const String
"The value is not in the specified inclusive range"
DEFAULT_IS_INSTANCE_OF_EX_MESSAGE → const String
"The instance of the validated object is invalid. Should have been %wish% but was %truth%"
DEFAULT_IS_NULL_EX_MESSAGE → const String
"The validated object is null"
DEFAULT_IS_TRUE_EX_MESSAGE → const String
"The validated expression is false"
DEFAULT_JSON_MESSAGE → const String
"The value is neither a num, String, bool, Null, List or Map"
DEFAULT_KEY_IN_MAP_MESSAGE → const String
"The key '%key%' is not available for this structure: %structure%"
DEFAULT_MATCHES_PATTERN_EX → const String
"The string does not match the pattern"
DEFAULT_NO_NULL_ELEMENTS_ARRAY_EX_MESSAGE → const String
"The validated array contains null element"
DEFAULT_NOT_BLANK_EX_MESSAGE → const String
"The validated string is blank"
DEFAULT_NOT_EMPTY_MESSAGE → const String
"The validated value is empty"
DEFAULT_VALID_INDEX_ARRAY_EX_MESSAGE → const String
"The validated array index is invalid"
DEFAULT_VALID_STATE_EX_MESSAGE → const String
"The validated state is false"
PATTERN_ALPHANUMERIC → const String
"^[a-zA-Z0-9öäüÖÄÜß]+\$"
PATTERN_EMAIL → const String
"^([0-9a-zA-Z]([-.+\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})\$"
PATTERN_HEX → const String
"^(0x[a-fA-F0-9]+)|([a-fA-F0-9])+\$"
PATTERN_PW → const String
"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#\$%?])[0-9a-zA-Z@#\$%?]{8,15}\$"
PATTERN_UUID → const String
"^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}\$"