getList<T> method

List<T> getList<T>(
  1. String key, [
  2. Decoder<T>? decode
])

Implementation

List<T> getList<T>(String key, [Decoder<T>? decode]) {
  if (map[key] == null) {
    throw ConverterException('Parameter $key is required.');
  } else if (map[key] is! List) {
    throw ConverterException('Parameter $key is not a List');
  }
  List value = map[key] as List<dynamic>;
  return value.map((dynamic item) => (decode ?? TextEncoder.i.decode<T>)(item)).toList();
}