Multi Contact Picker

pub pub points popularity likes

A highly customisable Flutter widget to read multiple contacts on Android and iOS including contact permission handling. Please note this package will not work on simulators

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's AndroidManifest.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);
    }
});