contacts_plugin 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

Flutter Contacts Plugin #

pub package

A Flutter contacts plugin which provides easy access to the platform specific address book.

BranchBuild Status
developBuild Status
masterBuild Status

Features #

  • Automatically check and request the necessary permissions to access the platform specific address book;
  • Read contacts from the addres book;
  • [WIP] Store new contacts in the address book;
  • [WIP] Update details of existing contacts;
  • [WIP] Delete existing contacts from the address book.

Usage #

To use this plugin, add contacts_plugin as a dependency in your pubspec.yaml file. For example:

  contacts_plugin: '^0.0.3'

NOTE: There's a known issue with integrating plugins that use Swift into a Flutter project created with the Objective-C template. See issue Flutter#16049 for help on integration.


Fetch all contacts #

To fetch all contacts from the address book make a call to the getContacts method:

import 'package:geolocator/contacts_plugin.dart';

List<Contact> contacts = await ContactsPlugin().getContacts();

Permissions #

Android #

On Android you'll need to add either the READ_CONTACTS or the WRITE_CONTACTS permissions to your Android Manifest (depending if you need read and/ or write access to the address book). Todo so open the AndroidManifest.xml file and one of the following two lines as direct children of the <manifest> tag:

<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />

iOS #

On iOS you'll need to add the NSContactsUsageDescription to your Info.plist file in order to access the device's address book. Simply open your Info.plist file and add the following:

<string>This app needs access to address book.</string>

Issues #

Please file any issues, bugs or feature request as an issue on our GitHub page.

Want to contribute #

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

Author #

This Contacts plugin for Flutter is developed by Baseflow. You can contact us at

0.0.3 #

  • Refactored the encoding and decoding of JSON messages.

0.0.2 #

  • Added build configuration for the build_runner

0.0.1 #

  • Initial release


import 'dart:math';

import 'package:flutter/material.dart';
import 'package:contacts_plugin/contacts_plugin.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        body: new SafeArea(
          child: ContactListWidget(),

class ContactListWidget extends StatelessWidget {
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: ContactsPlugin().getContacts(),
      builder: (BuildContext context, AsyncSnapshot<List<Contact>> snapshot) {
        if (!snapshot.hasData) {
          return Center(child: CircularProgressIndicator());

        return ListView(
     => ContactWidget(contact)).toList(),

class ContactWidget extends StatelessWidget {
  final Contact _contact;


  Widget build(BuildContext context) {
    return ListTile(
      leading: CircleAvatar(
              Colors.primaries[Random().nextInt(Colors.primaries.length - 1)],
              Text(_contact.displayName?.substring(0, 1)?.toUpperCase() ?? "")),
      title: Text(_contact.displayName ?? "<null>"),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  contacts_plugin: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:contacts_plugin/contacts_plugin.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.8

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (permission_handler).

Package is getting outdated. (-45.21 points)

The package was last published 75 weeks ago.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
permission_handler ^2.0.0 2.2.0 4.2.0+hotfix.3
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies