Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL Sosial
bisago
bisago-fe
Commits
57a8321b
Verified
Commit
57a8321b
authored
Jun 04, 2021
by
Muhammad Ariq Basyar
Browse files
[CHORE] fix login with google
parent
80e608c4
Pipeline
#81263
passed with stages
in 17 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/page/login/login.dart
View file @
57a8321b
...
...
@@ -225,6 +225,7 @@ class LoginState extends State<Login> {
}
Future
<
void
>
_updateUser
(
UpdateUserModel
updateUserModel
)
async
{
updateUserModel
.
foto
=
''
;
final
updatedUser
=
await
_userBloc
.
updateUser
(
updateUserModel
);
if
(
updatedUser
!=
null
)
{
successUserUpdateDialog
(
context
);
...
...
@@ -349,23 +350,14 @@ class LoginState extends State<Login> {
}
Future
<
void
>
_handleSignIn
()
async
{
try
{
await
_handleSignOut
();
final
googleSignInAccount
=
await
_googleSignIn
.
signIn
();
final
googleSignInAuthentication
=
await
googleSignInAccount
.
authentication
;
await
_handleSignOut
();
final
googleSignInAccount
=
await
_googleSignIn
.
signIn
();
final
googleSignInAuthentication
=
await
googleSignInAccount
.
authentication
;
final
token
=
googleSignInAuthentication
.
accessToken
;
await
login
(
_currentUser
.
email
,
''
,
'true'
,
token
,
_currentUser
.
displayName
);
sharedPreferences
=
await
SharedPreferences
.
getInstance
();
successDialog
(
context
);
Timer
(
const
Duration
(
seconds:
2
),
()
{
Navigator
.
pushNamed
(
context
,
'/'
);
});
}
catch
(
error
)
{
failedDialog
(
context
);
}
final
token
=
googleSignInAuthentication
.
accessToken
;
await
login
(
_currentUser
.
email
,
''
,
'true'
,
token
,
_currentUser
.
displayName
);
}
Future
<
void
>
_handleSignOut
()
async
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment