firebase / FirebaseUI-Flutter

Apache License 2.0
93 stars 81 forks source link

fix(firebase_ui_oauth): Fix provider auth listener late init exception #107

Closed Rexios80 closed 10 months ago

Rexios80 commented 10 months ago

Description

It's possible for the provider to get recreated when the button rebuilds. Since the authListener is set in initState it only happens the first time. Any auth methods called on the provider after the second rebuild will throw a late initialization error since the authListener will not be set. This PR adds code to store the provider in the state so that it cannot get reset externally.

I also set the isLoading to false in the onError callback otherwise the button will get stuck in a loading state when there is an error.

Related Issues

I don't see one

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

Rexios80 commented 10 months ago

Not sure why the CI is failing. I think it's trying to run tests that don't exist?

Rexios80 commented 10 months ago

Yeah the test file for firebase_ui_oauth_example is empty

Rexios80 commented 10 months ago

@lesnitsky Do you have an ETA on releasing this to pub.dev?