getAsList<E> method
Implementation
List<E>? getAsList<E>(
String key, {
List<E>? defaultValue,
bool caseSensitive = false,
}) {
var l = get(key, defaultValue: defaultValue, caseSensitive: caseSensitive);
if (l == null) return null;
if (l is! List) {
throw StateError("Can't return key `$key` as `List`: $l");
}
return l is List<E> ? l : l.cast<E>();
}