diff --git a/packages/flutterfire_authenticator/lib/src/authenticator.dart b/packages/flutterfire_authenticator/lib/src/authenticator.dart index 5a963ed..112d565 100644 --- a/packages/flutterfire_authenticator/lib/src/authenticator.dart +++ b/packages/flutterfire_authenticator/lib/src/authenticator.dart @@ -29,6 +29,9 @@ class Authenticator { /// 現在サインイン中のユーザー。サインインしていない場合はnullを返す。 User? get user => _auth.currentUser; + /// Listens for changes to the currently signed-in user. + late final Stream userChanges = _auth.userChanges(); + /// 現ユーザーのJWT(JSON Web Token)を非同期で取得する。 /// 未サインイン時など、現ユーザーが存在しない場合はnullを返す。 Future? get fetchJwt => _auth.currentUser?.getIdToken(); diff --git a/packages/flutterfire_authenticator/test/authenticator_test.dart b/packages/flutterfire_authenticator/test/authenticator_test.dart index 4cbdb8a..54783fb 100644 --- a/packages/flutterfire_authenticator/test/authenticator_test.dart +++ b/packages/flutterfire_authenticator/test/authenticator_test.dart @@ -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 // related links: // https://github.com/firebase/flutterfire/blob/master/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart // setupFirebaseAuthMocks