All Projects → lukasgit → Flutter_contacts

lukasgit / Flutter_contacts

Licence: mit
A Flutter plugin to retrieve and manage contacts on Android and iOS devices. Maintainer: @lukasgit

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Flutter contacts

Flutter web auth
Flutter plugin for authenticating a user with a web service
Stars: ✭ 81 (-31.93%)
Mutual labels:  flutter-plugin
Flutter Apps Collection
This is a repository of a collection of apps made in flutter
Stars: ✭ 98 (-17.65%)
Mutual labels:  flutter-plugin
Drawer Behavior Flutter
Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
Stars: ✭ 110 (-7.56%)
Mutual labels:  flutter-plugin
Json to form
A flutter plugin to use convert Json to Form
Stars: ✭ 82 (-31.09%)
Mutual labels:  flutter-plugin
Octo image
A multifunctional Flutter image widget
Stars: ✭ 97 (-18.49%)
Mutual labels:  flutter-plugin
Painter
A simple flutter widget to paint with your fingers
Stars: ✭ 99 (-16.81%)
Mutual labels:  flutter-plugin
Intent
A simple Flutter plugin to deal with Android Intents, written with ❤️
Stars: ✭ 79 (-33.61%)
Mutual labels:  flutter-plugin
Flutter Adaptivecards
AdaptiveCards for Flutter 🐦
Stars: ✭ 117 (-1.68%)
Mutual labels:  flutter-plugin
Amap location fluttify
高德地图 定位组件 Flutter插件
Stars: ✭ 97 (-18.49%)
Mutual labels:  flutter-plugin
Flutter local notifications
A Flutter plugin for displaying local notifications on Android, iOS, macOS and Linux
Stars: ✭ 1,724 (+1348.74%)
Mutual labels:  flutter-plugin
In app review
A Flutter plugin for showing the In-App Review/System Rating pop up on Android, IOS, and MacOS. It makes it easy for users to rate your app.
Stars: ✭ 85 (-28.57%)
Mutual labels:  flutter-plugin
Flutter weather bg
A rich and cool weather dynamic background plug-in
Stars: ✭ 89 (-25.21%)
Mutual labels:  flutter-plugin
Screenshot
Flutter Screenshot Library
Stars: ✭ 100 (-15.97%)
Mutual labels:  flutter-plugin
Flutter plugin pdf viewer
A flutter plugin for handling PDF files. Works on both Android & iOS
Stars: ✭ 81 (-31.93%)
Mutual labels:  flutter-plugin
Super enum
Create super-powered dart enums similar to sealed classes in Kotlin
Stars: ✭ 114 (-4.2%)
Mutual labels:  flutter-plugin
Firebase dart sdk
Unofficial Firebase Flutter SDK. Maintainer: @long1eu
Stars: ✭ 80 (-32.77%)
Mutual labels:  flutter-plugin
Launch review
A Flutter plugin to assist in leaving user reviews/ratings in the Google Play Store. Supports both Android and iOS.
Stars: ✭ 98 (-17.65%)
Mutual labels:  flutter-plugin
Youtube player
A flutter plugin to play Youtube Videos without API Key in range of Quality(144p, 240p,360p,480p,720p and 1080p).
Stars: ✭ 118 (-0.84%)
Mutual labels:  flutter-plugin
Edge detection
This is a flutter plugin to detect edges in a live camera, take the picture of detected edges object, crop it, and save.
Stars: ✭ 116 (-2.52%)
Mutual labels:  flutter-plugin
Nav router
flutter The lightest, easiest and most convenient route management!
Stars: ✭ 101 (-15.13%)
Mutual labels:  flutter-plugin

contacts_service

pub package Build Status Coverage Status

A Flutter plugin to access and manage the device's contacts.

Usage

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

dependencies:  
    contacts_service: ^0.5.0-nullsafety.0

Permissions

Android

Add the following permissions to your AndroidManifest.xml:

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

iOS

Set the NSContactsUsageDescription in your Info.plist file

<key>NSContactsUsageDescription</key>  
<string>This app requires contacts access to function properly.</string>  

Note
contacts_service does not handle the process of asking and checking for permissions. To check and request user permission to access contacts, try using the following plugins: flutter_simple_permissions or permission_handler.

If you do not request user permission or have it granted, the application will fail. For testing purposes, you can manually set the permissions for your test app in Settings for your app on the device that you are using. For Android, go to "Settings" - "Apps" - select your test app - "Permissions" - then turn "on" the slider for contacts.

Example

// Import package  
import 'package:contacts_service/contacts_service.dart';  
  
// Get all contacts on device
Iterable<Contact> contacts = await ContactsService.getContacts();  

// Get all contacts without thumbnail (faster)
Iterable<Contact> contacts = await ContactsService.getContacts(withThumbnails: false);

// Android only: Get thumbnail for an avatar afterwards (only necessary if `withThumbnails: false` is used)
Uint8List avatar = await ContactsService.getAvatar(contact);
  
// Get contacts matching a string
Iterable<Contact> johns = await ContactsService.getContacts(query : "john");

// Add a contact  
// The contact must have a firstName / lastName to be successfully added  
await ContactsService.addContact(newContact);  
  
// Delete a contact
// The contact must have a valid identifier
await ContactsService.deleteContact(contact);  

// Update a contact
// The contact must have a valid identifier
await ContactsService.updateContact(contact);

// Usage of the native device form for creating a Contact
// Throws a error if the Form could not be open or the Operation is canceled by the User
await ContactsService.openContactForm();

// Usage of the native device form for editing a Contact
// The contact must have a valid identifier
// Throws a error if the Form could not be open or the Operation is canceled by the User
await ContactsService.openExistingContact(contact);

Contact Model

// Name
String displayName, givenName, middleName, prefix, suffix, familyName;

// Company
String company, jobTitle;

// Email addresses
Iterable<Item> emails = [];

// Phone numbers
Iterable<Item> phones = [];

// Post addresses
Iterable<PostalAddress> postalAddresses = [];

// Contact avatar/thumbnail
Uint8List avatar;

Example

Contributions

Contributions are welcome! If you find a bug or want a feature, please fill an issue.

If you want to contribute code please create a pull request under the staging branch.

Credits

Heavily inspired from rt2zz's react native plugin

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].