equalTo method Null safety

QueryExpressionJunction<T, InstanceType> equalTo(
  1. T value,
  2. {bool caseSensitive = true}

Adds an equality expression to a query.

A query will only return objects where the selected property is equal to value.

This method can be used on int, String, bool, double and DateTime types.

If value is String, the flag caseSensitive controls whether or not equality is case-sensitively compared.


  final query = new Query<User>()
    ..where((u) => u.id ).equalTo(1);


QueryExpressionJunction<T, InstanceType> equalTo(T value,
    {bool caseSensitive = true}) {
  if (value is String) {
    expression = StringExpression(value, PredicateStringOperator.equals,
        caseSensitive: caseSensitive, allowSpecialCharacters: false);
  } else {
    expression = ComparisonExpression(value, PredicateOperator.equalTo);

  return _createJunction();