Repository navigation
Conversation
The `firebase_ui_oauth` example app never calls `Firebase.initializeApp()`.
`OAuthProviderButtonBase` resolves `FirebaseAuth.instance` in `initState`, so
every button throws on startup ("Null check operator used on a null value"
from `Firebase.app()` on web) and the example renders error widgets instead
of the provider buttons.
This initializes Firebase with the example's existing
`firebase_options.dart`, matching the other example apps in the repo
(`firebase_ui_auth`, `firebase_ui_firestore`, `firebase_ui_database`,
`firebase_ui_storage`, `firebase_ui_localizations`).
- `dart analyze --fatal-infos` reports no issues in the example.
- `flutter build web` succeeds. In a headless browser the app now renders
the Apple, Facebook, Google and Twitter buttons with their icons, with no
console errors. Before this change the button area was an error widget.
- `melos run analyze` and `melos run test:unit:all` pass.
Found while testing firebase#752.
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] My PR includes unit or integration tests for _all_ changed/updated/fixed behaviors.
- [x] All existing and new tests are passing.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] The analyzer (`melos run analyze`) does not report any problems on my PR.
- [x] All unit tests pass (`melos run test:unit:all` doesn't fail).
- [x] I read and followed the Flutter Style Guide.
- [x] I signed the CLA.
- [x] I am willing to follow-up on review comments in a timely manner.
- [ ] Yes, this is a breaking change.
- [x] No, this is _not_ a breaking change.
There was a problem hiding this comment.
Code Review
This pull request updates the example application in packages/firebase_ui_oauth to properly initialize Firebase. It adds imports for firebase_core and firebase_options.dart, and invokes Firebase.initializeApp with DefaultFirebaseOptions.currentPlatform in the main function. I have no feedback to provide as there are no review comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
firebase_ui_oauthexample app never callsFirebase.initializeApp().OAuthProviderButtonBaseresolvesFirebaseAuth.instanceininitState, so every button throws on startup ("Null check operator used on a null value" fromFirebase.app()on web) and the example renders error widgets instead of the provider buttons.This initializes Firebase with the example's existing
firebase_options.dart, matching the other example apps in the repo (firebase_ui_auth,firebase_ui_firestore,firebase_ui_database,firebase_ui_storage,firebase_ui_localizations).dart analyze --fatal-infosreports no issues in the example.flutter build websucceeds. In a headless browser the app now renders the Apple, Facebook, Google and Twitter buttons with their icons, with no console errors. Before this change the button area was an error widget.melos run analyzeandmelos run test:unit:allpass.Found while testing #752.
Checklist
///).melos run analyze) does not report any problems on my PR.melos run test:unit:alldoesn't fail).Breaking Change