decodeFuture<T> method

Future<T> decodeFuture<T>({
  1. Decodable<T>? using,
})

Decodes a Future of T using the provided Decodable.

Implementation

Future<T> decodeFuture<T>({Decodable<T>? using}) {
  final next = whatsNext();
  if (next is DecodingType<Future> || next is DecodingType<Stream>) {
    return decodeObject<Future<T>>(using: AsyncDecodable._future<T>(using));
  } else {
    return Future.value(decodeObject<T>(using: using));
  }
}