-
Notifications
You must be signed in to change notification settings - Fork 4
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
#146 add disable user account #185
Conversation
…r-app into #146_add_disable_user_account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
View の1箇所以外完璧 of 完璧です!さすがです!!
@@ -180,6 +181,21 @@ class _DrawerChild extends ConsumerWidget { | |||
title: const Text('開発ページへ'), | |||
onTap: () => context.router.pushNamed(DevelopmentItemsPage.location), | |||
), | |||
Visibility( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AuthDependentBuilder を使ってみてください!(onUnAuthenticated に const SizedBox とかを使うといいとおもいます!)
そこからもらえる userId を使えば、nullable な userIdProvider を使わずに済みます🙆♂️
※ あともしそれがないとしても、ログインの有無で見せる見せないを制御するには、Visibility ではなく、単に collection if で良いはずです!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビューありがとうございます!
590db5b
で、AuthDependentBuilder に変更しました!
あと、恥ずかしながら collection if 初めて知りました・・・毎度勉強になります!
ありがとうございます!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
後学のためにお伺いしたいのですが、
138行目あたり
if (ref.watch(isSignedInProvider)) ...[
ListTile(
leading: const Icon(Icons.person),
title: Text(ref.watch(userIdProvider)!),
),
で、ref.watch(userIdProvider)!
がありますが、ここで AuthDependentBuilder
を使用していないのは何か理由や意図があるのでしょうか?
if (ref.watch(isSignedInProvider))
で判定しているので、ref.watch(userIdProvider)!
で問題ないことは理解しているつもりなのですが、もし使い分けとかがあるので知りたいと思った次第です!
…r-app into #146_add_disable_user_account # Conflicts: # packages/firebase_common/lib/src/firestore_repositories/_export.dart # packages/mottai_flutter_app/lib/firestore_repository.dart
} on FirebaseAuthException catch (e) { | ||
if (e.code == 'user-disabled') { | ||
_appScaffoldMessengerController.showSnackBar('このアカウントは退会済みのため無効です。'); | ||
} else { | ||
_appScaffoldMessengerController.showSnackBarByFirebaseException(e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
退会済みのアカウントでログインしようとした場合に、無効であることを通知するようにしてみました!
(冒頭に動画を添付しているので参照ください)
required String userId, | ||
}) async { | ||
await _createDisableUserAccountRequest(userId: userId); | ||
await _authService.signOut(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
退会処理後にログイン状態が保持されてしまうようだったので、サインアウト処理を追加しました。
Navigator.pop(context); | ||
await _showDisableUserAccountCompletedDialog(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
退会処理が実行された後、退会処理が完了したことを通知するダイアログを追加してみました!
(冒頭のコメントに当該箇所の動画を貼りましたので参照ください)
Issue
close #146
説明
退会機能を実装する。
UI
退会処理実行時
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-09-11.at.22.21.00.mp4
退会処理実行後にログインしようとした時の挙動
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-09-11.at.22.21.21.mp4
その他
チェックリスト