decodeObject<T> method

  1. @override
T decodeObject<T>({
  1. Decodable<T>? using,
})
override

Decodes the data as an object of type T.

This forwards the decoding to the provided Decodable implementation. Otherwise tries to decode the data to a supported primitive type T.

This should only be called if the format returned a DecodingType<T> from whatsNext or is otherwise known to support T as a custom type.

Implementation

@override
T decodeObject<T>({Decodable<T>? using}) {
  if (using != null) {
    return using.decode(this);
  } else {
    return _unpacker._unpack() as T;
  }
}