equalTo method

Query? equalTo(
  1. dynamic value,
  2. {String? key}
)

Create a query constrained to only return child nodes with the given value (and key, if provided).

If a key is provided, there is at most one such child as names are unique.

Implementation

Query equalTo(dynamic value, {String key}) {
  assert(!_parameters.containsKey('equalTo'));
  assert(value is String ||
      value is bool ||
      value is double ||
      value is int ||
      value == null);
  final Map<String, dynamic> parameters = <String, dynamic>{'equalTo': value};
  if (key != null) parameters['equalToKey'] = key;
  return _copyWithParameters(parameters);
}