Where class

Inheritance

Constructors

Where(String evaluatedField, {dynamic value, Compare? compare, bool? isRequired})
A condition that evaluates to true in the Provider should return Model.
const
Where.exact(String evaluatedField, dynamic value, {bool isRequired = true})
A condition written with brevity. required defaults true.
factory

Properties

compare Compare
The kind of comparison of the evaluatedField to the value. Defaults to Compare.equals. It is the responsibility of the Provider to ignore or interpret the requested comparison.
final
conditions List<WhereCondition>?
Nested conditions. Leave unchanged for WhereConditions that do not nest.
finalinherited
evaluatedField String
The Dart name of the field. For example, myField when querying final String myField.
final
hashCode int
The hash code for this object.
no setterinherited
isRequired bool
Whether the condition(s) must evaluate to true. Defaults true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → dynamic
The value to compare on the evaluatedField.
final

Methods

contains(dynamic value) Where
doesNotContain(dynamic value) Where
isBetween(dynamic value1, dynamic value2) Where
isExactly(dynamic value) Where
isGreaterThan(dynamic value) Where
isGreaterThanOrEqualTo(dynamic value) Where
isLessThan(dynamic value) Where
isLessThanOrEqualTo(dynamic value) Where
isNot(dynamic value) Where
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

byField(String fieldName, List<WhereCondition>? conditions) List<WhereCondition>
Recursively find conditions that evaluate a specific field. A field is a member on a model, such as myUserId in final String myUserId. If the use case for the field only requires one result, say id or primaryKey, firstByField may be more useful.
firstByField(String fieldName, List<WhereCondition>? conditions) WhereCondition?
Find the first occurrance of a condition that evaluates a specific field For all conditions, use byField.

Constants

defaults → const Where