where method
Applies the predicate as the where clause, which will be used to filter
results.
The clause should only refer to columns defined in one of the tables
specified during SimpleSelectStatement.join.
With the example of a todos table which refers to categories, we can write something like
final query = select(todos)
.join([
leftOuterJoin(categories, categories.id.equalsExp(todos.category)),
])
..where(todos.name.like("%Important") & categories.name.equals("Work"));
Implementation
SelectStatement where(Expression<bool> predicate) {
if (whereClause == null) {
whereClause = WhereClause(predicate);
} else {
whereClause = WhereClause(whereClause!.condition & predicate);
}
return this;
}