https://github.com/developer-shubham101/mobile_no_hint
https://github.com/developer-shubham101/mobile_no_hint
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/developer-shubham101/mobile_no_hint
- Owner: developer-shubham101
- License: apache-2.0
- Created: 2024-08-02T12:37:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T12:47:08.000Z (almost 2 years ago)
- Last Synced: 2026-01-11T16:20:47.748Z (5 months ago)
- Language: Dart
- Size: 87.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# mobile_no_hint
The `mobile_no_hint` Flutter package offers an easy method to retrieve phone number hints from a user's device using the Phone Number Hint API.
Please check the original doc as well [https://developers.google.com/identity/phone-number-hint/android](https://developers.google.com/identity/phone-number-hint/android)
## Getting Started
### Import package
```dart
import 'package:mobile_no_hint/mobile_no_hint.dart';
```
Call function in initState
```dart
@override
void initState() {
super.initState();
if (Platform.isAndroid) {
MobileNoHint mobileNumber = MobileNoHint();
WidgetsBinding.instance
.addPostFrameCallback((timeStamp) => mobileNumber.mobileNumber());
mobileNumber.getMobileNumberStream.listen((event) {
if (event?.states == PhoneNumberStates.PhoneNumberSelected) {
_mobileController.text = event!.phoneNumber!;
}
});
}
}
```