Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jayeshpansheriya/flutter_native_contact_picker
With this plugin a Flutter app can ask its user to select a contact from his/her address book. The information associated with the contact is returned to the app.
https://github.com/jayeshpansheriya/flutter_native_contact_picker
android contact-picker flutter ios
Last synced: about 1 month ago
JSON representation
With this plugin a Flutter app can ask its user to select a contact from his/her address book. The information associated with the contact is returned to the app.
- Host: GitHub
- URL: https://github.com/jayeshpansheriya/flutter_native_contact_picker
- Owner: jayeshpansheriya
- License: bsd-3-clause
- Created: 2020-08-27T11:05:05.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-15T11:25:38.000Z (4 months ago)
- Last Synced: 2024-09-15T18:55:00.535Z (4 months ago)
- Topics: android, contact-picker, flutter, ios
- Language: Kotlin
- Homepage: https://pub.dev/packages/flutter_native_contact_picker
- Size: 184 KB
- Stars: 8
- Watchers: 2
- Forks: 22
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_native_contact_picker
With this plugin a Flutter app can ask its user to select a contact or contacts from his/her address book. The information associated with the contacts is returned to the app.
This plugin uses the operating system's native UI for selecting contacts and does not require any special permissions from the user.
Currently, the plugin only supports picking phone numbers. However, it should be easy to extend the plugin to request other properties from a contact (e.g. addresses) or to obtain the entire record of a contact (PRs are welcome).
## Features
- [x] iOS Support
- Select single contact
- Select multiple contacts- [x] Android Support
- Select single contact### Example
```dart
void main() {
runApp(const MyApp());
}class MyApp extends StatefulWidget {
const MyApp({super.key});@override
State createState() => _MyAppState();
}class _MyAppState extends State {
final FlutterNativeContactPicker _contactPicker =
FlutterNativeContactPicker();
List? _contacts;@override
void initState() {
super.initState();
}@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Contact Picker Example App'),
),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
MaterialButton(
color: Colors.blue,
child: const Text("Single"),
onPressed: () async {
Contact? contact = await _contactPicker.selectContact();
setState(() {
_contacts = contact == null ? null : [contact];
});
},
),
MaterialButton(
color: Colors.blue,
child: const Text("Multiple"),
onPressed: () async {
final contacts = await _contactPicker.selectContacts();
setState(() {
_contacts = contacts;
});
},
),
if (_contacts != null)
..._contacts!.map(
(e) => Text(e.toString()),
)
],
),
),
),
);
}
}```