ValidatorMixin<T extends Validator> class

Enables a validator to be used as a mixin.

Example:

part 'person.gval.dart';

class Person with ValidatorMixin<PersonValidator> {
  @NotNull()
  String name;
}

@GenValidator
class PersonValidator extends Validator<Person> with $_PersonValidator {}

final person = Person(name: 'John Doe');

person.validate();
person.validateProperty('name');
person.validateValue('name', 'Whom Ever');
person.errorCheck('name', 'Whom Ever);

Constructors

ValidatorMixin()

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
Returns a string representation of this object.
inherited
validate() Set<ConstraintViolation>
validateProperty(String name) Set<ConstraintViolation>
validateValue(String name, Object value) Set<ConstraintViolation>

Operators

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