has method

bool has(
  1. String key,
  2. dynamic value
)

Whether this map contains the given key/value pair.

This method checks if the key exists in the map and the value of the key is equal to the value passed to the method.

Example:

Map<String, dynamic> map = {'id': 1, 'name': 'Desk', 'price': 200};
print(map.has("id", 1)); // true
print(map.has("id", 2)); // false

Implementation

bool has(String key, value) => containsKey(key) && this[key] == value;