ValidatorAnnotation class abstract

Create ValidatorAnnotation

annotation class to validate an instance or property in a class

implements this class to create new decorator

Implementers
Annotations
  • @Target({TargetKind.field})

Constructors

ValidatorAnnotation.new({required String name, String? fieldName, String? errorMessage})
const

Properties

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

Methods

isValid(dynamic value) bool
implement this function to validate value
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?

Operators

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