Asserts that the list is not empty
static void notEmptyList(List? list, [String? message]) { if (list == null || list.isEmpty) { throw AssertionError(message ?? 'List must not be empty'); } }