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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Why authRepositoryProvider watch FirebaseAuth.instance? #141

Open
gothedistance opened this issue Sep 23, 2023 · 0 comments
Open

Comments

@gothedistance
Copy link

gothedistance commented Sep 23, 2023

In firebase_auth_repository.dart, authRepository watch firebaseAuthProvider.

@Riverpod(keepAlive: true)
FirebaseAuth firebaseAuth(FirebaseAuthRef ref) {
  return FirebaseAuth.instance;
}

@Riverpod(keepAlive: true)
AuthRepository authRepository(AuthRepositoryRef ref) {
  return AuthRepository(ref.watch(firebaseAuthProvider));
}

Llistening to FirebaseAuth.instance using ref.watch.
This implies that there could be changes FirebaseAuth.instance itself.

Does FirebaseAuth.instance actually change automatically?
FirebaseAuth.instance implements static get, object id will not change.

I would like to know if there are cases where performing operations with Firebase Authentication results in changes to FirebaseAuth.instance.

@gothedistance gothedistance changed the title Why authRepositoryProvider watch FirebaseAuth.instance? Question: Why authRepositoryProvider watch FirebaseAuth.instance? Sep 23, 2023
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

No branches or pull requests

1 participant