Promise<T>.futureToPromise constructor

Promise<T>.futureToPromise(
  1. Future<T> future
)

Implementation

factory Promise.futureToPromise(Future<T> future) {
  return Promise<T>(allowInterop((Function resolve, Function reject) {
    future.then((result) => resolve(result), onError: reject);
  }));
}