Future.value factory constructor

Future.value([result ])

A future whose value is available in the next event-loop iteration.

If result is not a Future, using this constructor is equivalent to new Future<T>.sync(() => result).

Use Completer to create a future and complete it later.

Source

factory Future.value([FutureOr<T> result]) {
  return new _Future<T>.immediate(result);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-async/Future/Future.value.html