UniqueRule<T extends Model> class

Validation rule that ensures a field value is unique in persistent storage.

The rule queries the target model type T using the configured column and passes validation only when no existing record is found.

Example:

final rule = UniqueRule<User>(column: 'email');

Constructors

UniqueRule({required String column})
Creates a uniqueness rule for the given model column.

Properties

column String
The database column to check for uniqueness.
final
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
validate({dynamic value}) Future<bool>
Validates that value does not already exist for the configured column.

Operators

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