whatsNext method
Returns the actual or preferred DecodingType of the encoded data.
Self-describing formats may return a DecodingType that indicates the type of the encoded data, or the preferred way of decoding it.
Non-self-describing formats may only return DecodingType.unknown for all types. In this case, the Decodable implementation must try the appropriate decoding method based on the expected type.
Implementation
@override
DecodingType whatsNext() {
skipWhitespace(); // Ensure we are at the start of a new value
if (buffer[offset] == tokenDollarSign) {
return const DecodingType<Stream>.custom();
}
return super.whatsNext();
}