Credential picker for Google Service
You can get your phone number without adding a phone permission to your app. Also you can get email or account info directly from your phone.
This picker is Android only
add plugin to your pubspec.yaml
flutter_credential_picker: ^0.0.1
CredentialPicker.pickPhoneNumber().then((value)=> setState((){
_credential = value
}));
or
try{
final result = CredentialPicker.pickPhoneNumber();
setState((){
_credential = result
}
} on NotFoundException catch(_){
...
}
} on AccountsNotFound catch(_){
...
}
} on NotSupportedPlatform catch(_){
...
}
} on MissingGoogleService catch(_){
...
}
CredentialPicker.pickEmail().then((value)=> setState((){
_credential = value
}));
or
try{
final result = CredentialPicker.pickEmail();
setState((){
_credential = result
}
} on NotFoundException catch(_){
...
}
} on AccountsNotFound catch(_){
...
}
} on NotSupportedPlatform catch(_){
...
}
} on MissingGoogleService catch(_){
...
}
You can specify account types query, default value is AccountType.google only
/// default accountTypes is [AccountType.google]
CredentialPicker.pickGoogleAccount().then((value)=> setState((){
_credential = value
}));
/// or you can add more supported account types as list
CredentialPicker.pickGoogleAccount(accountTypes: [
AccountType.google,
AccountType.facebook,
AccountType.twitter,
AccountType.microsoft
]).then((value)=> setState((){
_credential = value
}));
or
try{
final result = CredentialPicker.pickGoogleAccount(accountTypes: [
AccountType.google,
AccountType.facebook,
AccountType.twitter,
AccountType.microsoft
]);
setState((){
_credential = result
}
} on NotFoundException catch(_){
...
}
} on AccountsNotFound catch(_){
...
}
} on NotSupportedPlatform catch(_){
...
}
} on MissingGoogleService catch(_){
...
}