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