koji-1009 / flutter_auth_ui

A Flutter plugin for using the Firebase Auth UI with Dart in Flutter apps. (not official plugin.)
https://pub.dev/packages/flutter_auth_ui
36 stars 10 forks source link

Auth on Web leaves a blank page #67

Closed EskAere closed 3 years ago

EskAere commented 3 years ago

Hi,

Auth works fine on Android. But on web, I have the following error :

Error: Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/navigation/history.dart:284:14
_userProvidedRouteName != null
is not true
    at Object.throw_ [as throw] (http://localhost:61027/dart_sdk.js:5041:11)
    at Object.assertFailed (http://localhost:61027/dart_sdk.js:4980:15)
    at _engine.SingleEntryBrowserHistory.new.onPopState (http://localhost:61027/dart_sdk.js:141776:59)

I'm not familiar with htlm code, but this occurs either after a successful login or when i press the back button, which call : html.window.history.back();

It seems like the firebaseUI is put "above" the page but not to an actual new link? As a result, I suppose that it pops out the only active page and leaves a blank screen?

koji-1009 commented 3 years ago

Yes, this is because the current implementation is not perfect and no solution has been found. (Actually, web support is very difficult.)

firebaseui-web is a mechanism that "replaces screen elements" instead of "transitioning the screen". Therefore, in flutter_auth_ui_web, the display is realized by "switching the view of Flutter with firebaseui-web". There is no page transition. https://github.com/koji-1009/flutter_auth_ui/blob/2.3.0/flutter_auth_ui_web/lib/flutter_auth_ui_web.dart#L107

EskAere commented 3 years ago

I see, that's unfortunate. Thanks for the answer!

It makes the plugin unusable for web I suppose.Lleaving the user with a blank page after login is not acceptable. I'll have to do a custom auth UI in the end

koji-1009 commented 3 years ago

Well, in the example implementation I got an error but no blank page. Flutter's web is unstable, so I'll take a look at it when I have time, but it's a low priority.

koji-1009 commented 3 years ago

In my environment, Flutter 2.5.0 no longer prints this error 🎉