Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

flutter flutter logo contacts service

Rating: 3 out of 5.

contacts service, a flutter plugin to access and manage the device’s contacts.

Retrieve & Manage Contacts Service
retrieve & manage contacts service
retrieve & manage contacts service

usage

to use this plugin, add contacts_service as a dependency in your pubspec.yaml file.

make sure you add the following permissions to your android manifest:

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

on ios, make sure to set nscontactsusagedescription in the info.plist file

<key>nscontactsusagedescription</key>
<string>this app requires contacts access to function properly.</string>

to check and request user permission to access contacts, i recommend using the following plugin: flutter_simple_permissions

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
iterable<contact> contacts = await contactsservice.getcontacts();

// 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 addded
await contactsservice.addcontact(newcontact);

// delete a contact
await contactsservice.deletecontact(contact);

todo

  • [ ] update contact

Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Top
PUY NOW VIA WHATSAPP