hasKey method

bool hasKey(
  1. String key
)

Checks if any map in the list contains the specified key.

key is the key to check for.

Example:

final hasAgeField = list.hasKey("age");

Implementation

bool hasKey(String key) => any(
      (T element) => element is Map<T, T> && element.containsKey(key),
    );