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

feat: Add user changes stream #21

Merged
merged 3 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Authenticator {
/// 現在サインイン中のユーザー。サインインしていない場合はnullを返す。
User? get user => _auth.currentUser;

/// Listens for changes to the currently signed-in user.
late final Stream<User?> userChanges = _auth.userChanges();

/// 現ユーザーのJWT(JSON Web Token)を非同期で取得する。
/// 未サインイン時など、現ユーザーが存在しない場合はnullを返す。
Future<String?>? get fetchJwt => _auth.currentUser?.getIdToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ void main() {
class MockAuth extends Fake implements FirebaseAuth {}

// TODO(riscait): add more tests
// https://github.com/altive/flutterfire_adapter/issues/20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

badge
Thanks for adding the Issue link!

// related links:
// https://github.com/firebase/flutterfire/blob/master/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart
// setupFirebaseAuthMocks
Expand Down