decodeReference<T> method

Reference<T> decodeReference<T>(
  1. String key, {
  2. int? id,
  3. Decodable<T>? using,
})

Decodes a Reference of T using the provided Decodable.

Implementation

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