Skip to content

Question: Why authRepositoryProvider watch FirebaseAuth.instance? #141

@gothedistance

Description

@gothedistance

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions