JValidationUtils class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
boolOrDefault(dynamic value, {bool defaultValue = false})
→ bool
-
Returns the
value as bool if valid, otherwise returns defaultValue.
-
dateOrDefault(dynamic value, {DateTime? defaultValue})
→ DateTime
-
Returns the
value as DateTime if valid, otherwise returns defaultValue or Epoch.
-
doubleOrDefault(dynamic value, {double defaultValue = 0.0})
→ double
-
Returns the
value as double if valid, otherwise returns defaultValue.
-
intOrDefault(dynamic value, {int defaultValue = 0})
→ int
-
Returns the
value as int if valid, otherwise returns defaultValue.
-
isTextLengthInRange(String? value, {int min = 1, int max = 255})
→ bool
-
Returns true if the string length is within
min and max bounds.
-
parseIntInRange(String? value, {int min = 0, int max = 100, int defaultValue = 0})
→ int
-
Parses a string to int and clamps it between
min and max. Returns defaultValue if parsing fails.
-
stringOrDefault(String? value, {String defaultValue = ''})
→ String
-
Returns the
value as non-empty string, otherwise returns defaultValue.