getList<T> method

List<T> getList<T>(
  1. String key, {
  2. MappingHooks? hooks,
})

Implementation

List<T> getList<T>(String key, {MappingHooks? hooks}) => hooked(hooks, key, (v) {
  if (v == null) {
    throw MapperException('Parameter $key is required.');
  } else if (v is! List) {
    throw MapperException('Parameter $v with key $key is not a List');
  }
  return v.map((dynamic item) => Mapper.fromValue<T>(item)).toList();
});