https://github.com/printeastwoodcz/flutter_credential_plugin
Credential picker for Google Service
https://github.com/printeastwoodcz/flutter_credential_plugin
account accounts android email flutter google googleservice phonenumber phonenumber-scrapping
Last synced: 4 months ago
JSON representation
Credential picker for Google Service
- Host: GitHub
- URL: https://github.com/printeastwoodcz/flutter_credential_plugin
- Owner: printeastwoodcz
- License: mit
- Created: 2020-10-14T04:41:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-15T05:46:54.000Z (over 5 years ago)
- Last Synced: 2025-10-23T05:59:38.242Z (8 months ago)
- Topics: account, accounts, android, email, flutter, google, googleservice, phonenumber, phonenumber-scrapping
- Language: Dart
- Homepage:
- Size: 67.4 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_credential_picker
**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.
## Supported platforms
This picker is **Android only**
## Getting Started
add plugin to your pubspec.yaml
```yaml
flutter_credential_picker: ^0.0.1
```
## Implementation
### Get Phone number
```dart
CredentialPicker.pickPhoneNumber().then((value)=> setState((){
_credential = value
}));
```
or
```dart
try{
final result = CredentialPicker.pickPhoneNumber();
setState((){
_credential = result
}
} on NotFoundException catch(_){
...
}
} on AccountsNotFound catch(_){
...
}
} on NotSupportedPlatform catch(_){
...
}
} on MissingGoogleService catch(_){
...
}
```
### Get Email address
```dart
CredentialPicker.pickEmail().then((value)=> setState((){
_credential = value
}));
```
or
```dart
try{
final result = CredentialPicker.pickEmail();
setState((){
_credential = result
}
} on NotFoundException catch(_){
...
}
} on AccountsNotFound catch(_){
...
}
} on NotSupportedPlatform catch(_){
...
}
} on MissingGoogleService catch(_){
...
}
```
### Get Account
You can specify account types query, default value is AccountType.google only
```dart
/// 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
```dart
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(_){
...
}
```