Skip to content

Conversation

@EchoEllet
Copy link

Description

The current code snippet in the README of firebase_ui_auth does not function after logging in with any authentication provider and will produce a runtime error.

This is due to passing the BuildContext of the root app widget as an argument to Navigator.pushReplacementNamed(), which lacks the details required to navigate to the profile screen, which is only defined in a BuildContext that is under MaterialApp.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • All unit tests pass (melos run test:unit:all doesn't fail).
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

…rrectly

The current code snippet in the README does not function after logging in with any authentication provider and will produce a runtime error.

This is due to using `Navigator` with the root widget's `BuildContext`, which lacks the details required to navigate to the profile screen, which is only known in a `BuildContext` that is under `MaterialApp`.
@EchoEllet EchoEllet changed the title docs(readme): use a valid BuildContext in onSignedIn() to navigate correctly docs(firebase_ui_auth): use a valid BuildContext in onSignedIn() to navigate correctly Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant