decodeReference<T> method

Reference<T> decodeReference<T>({
  1. Decodable<T>? using,
})

Decodes a Reference of T using the provided Decodable.

Implementation

Reference<T> decodeReference<T>({Decodable<T>? using}) {
  final next = whatsNext();
  if (next is DecodingType<Reference> || next is DecodingType<Future> || next is DecodingType<Stream>) {
    return decodeObject<Reference<T>>(using: ReferenceDecodable<T>._(using: using));
  } else {
    return Reference(decodeObject<T>(using: using));
  }
}