firebase_auth_web.dart too many positional arguments

When biulding a Flutter web app connected to Firebase, the auth web has a small error en flutter_auth_web.dart, line 94.

static void registerWith(Registrar registrar) {
    FirebaseCoreWeb.registerService('auth', (firebaseApp) async {
      final authDelegate = auth_interop.getAuthInstance(firebaseApp);
      // if localhost, and emulator was previously set in localStorage, use it
      if (window.location.hostname == 'localhost' && kDebugMode) {
        final String? emulatorOrigin =
            window.sessionStorage[getOriginName(firebaseApp.name)];

the argument for the function needs to be named, so instead it has to look like this:

static void registerWith(Registrar registrar) {
    FirebaseCoreWeb.registerService('auth', ensurePluginInitialized: (firebaseApp) async {
      final authDelegate = auth_interop.getAuthInstance(firebaseApp);
      // if localhost, and emulator was previously set in localStorage, use it
      if (window.location.hostname == 'localhost' && kDebugMode) {
        final String? emulatorOrigin =
            window.sessionStorage[getOriginName(firebaseApp.name)];

now it worked.

I have it already working. Problem solved

Upvotes: 1

Views: 130

Answers (0)

Related Questions