validateListNotEmpty<T> static method

void validateListNotEmpty<T>(
  1. List<T> list,
  2. String paramName
)

Validate that a list is not empty

Implementation

static void validateListNotEmpty<T>(List<T> list, String paramName) {
  if (list.isEmpty) {
    throw ArgumentError('$paramName cannot be empty');
  }
}