decodeIterated method

  1. @override
IteratedDecoder decodeIterated(
  1. String key, {
  2. int? id,
})
override

Decodes the data for the given key or id as an iterated collection of nested data.

Implementation

@override
IteratedDecoder decodeIterated(String key, {int? id}) {
  try {
    return StandardIteratedDecoder._(_value[key] as List, _isHumanReadable, _customTypes);
  } on TypeError {
    throw CodableException.wrap(
      CodableException.unexpectedType(expected: 'List', actual: '${_value[key].runtimeType}', data: _value[key]),
      method: 'decode',
      hint: '["$key"]',
    );
  }
}