Finally, please make these things more dart-y by providing extra conversions in the box. Dart's learning curve is already steep enough without every developer having to figure out javascript and ecmascript6. Add the following bits and bytes:
Future signInWithPopup() {
var c = new Completer();
Promise promise = new Promise(jsElement.callMethod('signInWithPopup'));
promise.then(([response]) {c.complete(decodeAuthData(response));});
promise.catchError(([error]) {c.completeError(error);});
return c.future;
}
/**
* Converts authData response from JsObject to native Dart object.
*/
dynamic decodeAuthData(JsObject authData) {
var json = js.context['JSON'].callMethod('stringify', [authData]);
return JSON.decode(json);
}
Firebase_auth. dart should allow no argument to be passed in to signInWithPopup, just like the JS version. Currently, this is required:
Also, I ran into https://github.com/firebase/polymerfire/issues/44 with rc9, so it would be a good idea to release a new version.
Finally, please make these things more dart-y by providing extra conversions in the box. Dart's learning curve is already steep enough without every developer having to figure out javascript and ecmascript6. Add the following bits and bytes: