IsStringValidator class

Metadata validator to check if value is instance of String

when allowNullable is true, will allow null value

if value Type is not String it will return false

Inheritance

Constructors

IsStringValidator.new({String? errorMessage, String? fieldName, bool allowNullable = true})
const

Properties

allowNullable bool
final
defaultErrorMessage String
default error message when errorMessage value is null
no setteroverride
errorMessage String
get error message
no setterinherited
fieldName String?
field name
finalinherited
hashCode int
The hash code for this object.
no setterinherited
name String
decorator name
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

isValid(dynamic value) bool
implement this function to validate value
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(dynamic value) String?
inherited

Operators

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