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
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
valuedoes not already exist for the configured column.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited