asFuture property

Future<T> get asFuture

Wraps this value in an already-completed Future.

Example:

final f = 42.asFuture; // Future<int> completing with 42

Implementation

Future<T> get asFuture => Future<T>.value(this);