Skip to content

Commit 2e3b212

Browse files
committed
refactor(ui): migrate LoginView to Provider pattern
1 parent 336610b commit 2e3b212

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/lib/features/auth/presentation/view/login_view.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ class _LoginViewState extends State<LoginView> {
2525
submitText: 'Đăng nhập',
2626
isLoading: _vm.isLoading,
2727
showSocial: true,
28+
onGoogleTap: () async {
29+
final error = await _vm.loginWithGoogle();
30+
if (error != null && context.mounted) {
31+
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(error), backgroundColor: AppColors.error));
32+
}
33+
},
34+
onFacebookTap: () async {
35+
final error = await _vm.loginWithFacebook();
36+
if (error != null && context.mounted) {
37+
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(error), backgroundColor: AppColors.error));
38+
}
39+
},
2840
onSubmit: () async {
2941
FocusScope.of(context).unfocus();
3042
final errorMessage = await _vm.login();

0 commit comments

Comments
 (0)