Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [firebase_ui_auth] Version 1.4.0 is causing compilation error #19

Closed
outdoorapps opened this issue May 12, 2023 · 7 comments
Closed
Labels

Comments

@outdoorapps
Copy link

The recent changes in version 1.4.0 are causing the following compilation error:

../../.pub-cache/hosted/pub.dev/firebase_ui_auth-1.4.0/lib/src/screens/profile_screen.dart:393:19: Error: Cannot invoke a non-'const' constructor where a const expression is expected. Try using a constructor or factory that is 'const'. const Row( ^^^

The const keyword wasn't there in version 1.3.0.

@darshankawar
Copy link

Thanks for the report @outdoorapps
I am unable to replicate it using the plugin example and running on Android. Can you provide dependencies you are using ?

@outdoorapps
Copy link
Author

I opened a blank project to test things out with bare minimum dependencies like the below.

dependencies:
  flutter:
    sdk: flutter

  firebase_core: ^2.12.0
  firebase_ui_auth: ^1.4.0
  cupertino_icons: ^1.0.2

The first time it compiled ok but if I use the ProfileScreen widget like this:

  @override
  Widget build(BuildContext context) {
    return const ProfileScreen();
  }

It will give the forementioned error.

Taking a closer look to the source code, in profile_screen.dart, on line 393-400, it has:

const Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                LoadingIndicator(size: 16, borderWidth: 0.5),
                SizedBox(width: 16),
                Text('Waiting for email verification'),
              ],
            )

Somehow the const keyword sneaked into the source code because not even const Row() would work currently on flutter.

@zachary-russell
Copy link
Contributor

Confirming I'm also having this issue.

@josephomills
Copy link

I'm also having the same issue. Row doesn't have a const constructor.

@zachary-russell
Copy link
Contributor

zachary-russell commented May 12, 2023

Attempting to submit a fix for this, how open source of me 馃槃. If people want to fix it themselves they can move the const down in the code of the file where the error was specified (profile_screen.dart):

            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: const [
                LoadingIndicator(size: 16, borderWidth: 0.5),
                SizedBox(width: 16),
                Text('Waiting for email verification'),
              ],
            )

@darshankawar
Copy link

Thanks for the details. Seeing the same error upon following info shared #19.

/cc @lesnitsky

@lesnitsky
Copy link
Member

Fixed by firebase/flutterfire#10957

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants