multi_contact_picker 1.1.2
multi_contact_picker: ^1.1.2 copied to clipboard
Select multiple contacts at once
Multi Contact Picker #
A highly customisable Flutter widget to read multiple contacts on Android and iOS including contact permission handling.
Get started #
Installation #
- iOS: Add the following key/value pair to your app's
Info.plist<plist version="1.0"> <dict> ... <key>NSContactsUsageDescription</key> <string>Reason we need access to the contact list</string> </dict> </plist> - Android: Add the following
<uses-permissions>tags to your app'sAndroidManifest.xml<manifest xmlns:android="http://schemas.android.com/apk/res/android" ...> <uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.WRITE_CONTACTS"/> <application ...> ...
Usage #
Multi contact can be used in two forms, as a fullscreen dialog or as a standalone screen. My personal preference is a fullscreen dialog.
1. Fullscreen dialog
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
//Customise the MultiContactPicker to your liking
return MultiContactPicker();
}).then((value) {
if (value != null){
debugPrint(value);
}
});
2. Material Page
Navigator.push(context,
MaterialPageRoute(
builder: (_) => MultiContactPicker()))
.then((value) {
if (value != null) {
// List of selected contacts will be returned to you
debugPrint(value);
}
});