notEmptyMap static method

void notEmptyMap(
  1. Map? map,
  2. String message
)

Asserts that the given map is not null and not empty.

Throws an InvalidArgumentException with the given message if the map is null or empty.

Example:

Assert.notEmptyMap(headers, 'Headers must not be empty');

Implementation

static void notEmptyMap(Map? map, String message) {
  if (map == null || map.isEmpty) {
    throw InvalidArgumentException(message);
  }
}