Unique class Null safety

Enforces that the value of a property is unique among all objects in a box before an object can be put.

Trying to put an object with offending values will result in a UniqueViolationException (see ConflictStrategy.fail). Set onConflict to change this strategy.

Note: Unique properties are based on an Index, so the same restrictions apply. It is supported to explicitly add the Index annotation to configure the index.

Constructors

Unique({ConflictStrategy onConflict = ConflictStrategy.fail})
Create a Unique annotation.
const

Properties

hashCode int
The hash code for this object.
read-only, inherited
onConflict ConflictStrategy
The strategy to use when a conflict is detected when an object is put.
final
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
A string representation of this object.
inherited

Operators

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