GithubHelp home page GithubHelp logo

ettaegbe / fast_contacts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from s0nerik/fast_contacts

0.0 0.0 0.0 1.55 MB

A faster way of accessing device's contacts list in Flutter

License: MIT License

Ruby 4.33% Objective-C 1.37% Kotlin 42.34% Dart 25.52% Swift 26.44%

fast_contacts's Introduction

fast_contacts

fast_contacts fast_contacts fast_contacts fast_contacts

A much faster alternative to contacts_service and flutter_contact for reading the device's contact book.

This plugin was tuned to achieve optimal performance for fetching the whole list of contacts. Loading 1000 contacts with this plugin should take ~200ms or less depending on the device.

Usage

To use this plugin, add fast_contacts as a dependency in your pubspec.yaml file.

Permissions

Android

Add the following permission to your AndroidManifest.xml:

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

iOS

Set the NSContactsUsageDescription in your Info.plist file

<key>NSContactsUsageDescription</key>  
<string>Description of why you need the contacts permission.</string>  

Note fast_contacts doesn't handle permissions. Use special plugins (like permission_handler) to ask for the permission before accessing contacts.

Available contact info

  • ID
  • Display name
  • Structured name (prefix, given name, middle name, family name, suffix)
  • Emails
  • Phones
  • Organization (company, department, job description)

Example

// Import package  
import 'package:fast_contacts/fast_contacts.dart';  

// Get all contacts
final contacts = await FastContacts.getAllContacts();

// Get first contact's image (thumbnail)
final thumbnail = await FastContacts.getContactImage(contacts[0].id);

// Get first contact's image (full size)
final thumbnail = await FastContacts.getContactImage(contacts[0].id, size: ContactImageSize.fullSize);

For a more complete usage example, see example project.

Performance

Loading 1000+ contacts (display name, structured name, phones, emails) at once takes ~200ms on both Android (Samsung Galaxy S8) and iOS (iPhone 8).

Android: Samsung Galaxy S8

iOS: iPhone 8

fast_contacts's People

Contributors

s0nerik avatar arjenfvellinga avatar pcolbp avatar ettaegbe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.