evaluate method

  1. @override
bool evaluate(
  1. T? other
)
override

Evaluates this QueryFieldOperator against other, where other is a field on the model.

Implementation

@override
bool evaluate(T? other) {
  // if `other` is Model, the query predicate is on a
  // nested model, such as `Post.BLOG.eq(myBlog.modelIdentifier))`,
  // and the value should be compared against the model ID.
  if (other is Model) {
    // TODO(Jordan-Nelson): Update to `return value == other.modelIdentifier`
    // when `getId()` is removed from Model.
    if (value is ModelIdentifier) {
      return value == other.modelIdentifier;
    } else {
      // ignore: deprecated_member_use_from_same_package
      return value == other.getId();
    }
  }

  return value == other;
}