DatumQueryField<E, V> class

A type-safe field descriptor for an entity of type E whose value type is V.

Used with DatumQueryBuilder.whereField / DatumQueryBuilder.orderByField to get compile-time checking of both the field's existence (it must belong to E) and the comparison value's type (it must be a V). The datum_generator emits one descriptor per serializable field, e.g.:

abstract class TaskFields {
  static const title = DatumQueryField<Task, String>('title');
  static const priority = DatumQueryField<Task, int>('priority');
}

// priority must be compared to an int — `isGreaterThan: 'x'` won't compile:
query.whereField(TaskFields.priority, isGreaterThan: 2);

Named DatumQueryField (not DatumField) to avoid clashing with the @DatumField annotation from datum_generator.

Implementers

Constructors

DatumQueryField(String name)
Creates a descriptor for the serialized name of a field on E.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isNotNull Filter
field IS NOT NULL
no setter
isNull Filter
field IS NULL
no setter
name String
The serialized field name (map key / column), supporting dot notation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

equalTo(V value) Filter
field == value
greaterThan(V value) Filter
field > value
greaterThanOrEqual(V value) Filter
field >= value
isIn(List<V> values) Filter
field IN values
isNotIn(List<V> values) Filter
field NOT IN values
lessThan(V value) Filter
field < value
lessThanOrEqual(V value) Filter
field <= value
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notEqualTo(V value) Filter
field != value
toString() String
A string representation of this object.
inherited

Operators

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