valueEnsureAsList<T> method
Reads key and casts it to List<T>.
Implementation
List<T> valueEnsureAsList<T>(
K key, {
List<T> Function(BuError err)? onError,
List<T> Function()? onMissing,
/// Only applicable when [K] is `String`.
bool normalizeKeyLookup = false,
}) {
try {
final value = _checkItem<List>(key, onMissing, normalizeKeyLookup);
return JsonParser.valueEnsureAsList<T>(value);
} on BuError catch (e) {
if (onError != null) return onError(e);
throw CoreErrors.jsonErrorWithKey(e, key);
}
}