Flutter: detect if user logged with Facebook or Google

368 Views Asked by At

User can log out doing this:

await _auth.signOut();

Because I want to ask always for an user, I also need to run also one of these lines:

await _googleSignIn.disconnect();
await _facebookSignIn.logOut();

How can I detect if the user logged in with Facebook or Google?

1

There are 1 best solutions below

0
On

_auth.currentUser().providerData[0].providerId does provide "google.com" or "facebook.com"