Promise<T>.futureToPromise constructor
Promise<T>.futureToPromise (
- 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);
}));
}