bizz84 / bizz84/starter_architecture_flutter_firebase

Question: Why authRepositoryProvider watch FirebaseAuth.instance?

Open
#141 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
1.8k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

In `firebase_auth_repository.dart`, `authRepository` watch `firebaseAuthProvider`.

```dart
@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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.