{"id":13492016,"url":"https://github.com/lukasgit/flutter_contacts","last_synced_at":"2025-05-16T11:07:25.252Z","repository":{"id":37733167,"uuid":"197782274","full_name":"lukasgit/flutter_contacts","owner":"lukasgit","description":"A Flutter plugin to retrieve and manage contacts on Android and iOS devices. Maintainer: @lukasgit","archived":false,"fork":false,"pushed_at":"2024-07-05T17:55:50.000Z","size":2023,"stargazers_count":214,"open_issues_count":39,"forks_count":303,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-12T05:42:47.020Z","etag":null,"topics":["android","flutter","flutter-plugin","ios"],"latest_commit_sha":null,"homepage":"https://pub.dartlang.org/packages/contacts_service","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukasgit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-19T14:00:16.000Z","updated_at":"2025-05-06T14:56:15.000Z","dependencies_parsed_at":"2024-01-16T09:45:07.586Z","dependency_job_id":"32ca3d0d-d1a2-45e6-9b5e-63a11ac2f412","html_url":"https://github.com/lukasgit/flutter_contacts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasgit%2Fflutter_contacts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasgit%2Fflutter_contacts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasgit%2Fflutter_contacts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasgit%2Fflutter_contacts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukasgit","download_url":"https://codeload.github.com/lukasgit/flutter_contacts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253685172,"owners_count":21947301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","flutter","flutter-plugin","ios"],"created_at":"2024-07-31T19:01:02.386Z","updated_at":"2025-05-16T11:07:20.232Z","avatar_url":"https://github.com/lukasgit.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"\n# contacts_service  \n[![pub package](https://img.shields.io/pub/v/contacts_service.svg)](https://pub.dartlang.org/packages/contacts_service)\n[![Build Status](https://travis-ci.com/lukasgit/flutter_contacts.svg?branch=master)](https://travis-ci.com/lukasgit/flutter_contacts)\n[![Coverage Status](https://coveralls.io/repos/github/clovisnicolas/flutter_contacts/badge.svg?branch=master)](https://coveralls.io/github/clovisnicolas/flutter_contacts?branch=master)\n\nA Flutter plugin to access and manage the device's contacts.  \n  \n## Usage  \n  \nTo use this plugin, add `contacts_service` as a [dependency in your `pubspec.yaml` file](https://flutter.io/platform-plugins/).  \nFor example:  \n```yaml  \ndependencies:  \n    contacts_service: ^0.6.3\n```  \n  \n## Permissions  \n### Android  \nAdd the following permissions to your AndroidManifest.xml:  \n  \n```xml  \n\u003cuses-permission android:name=\"android.permission.READ_CONTACTS\" /\u003e  \n\u003cuses-permission android:name=\"android.permission.WRITE_CONTACTS\" /\u003e  \n```  \n### iOS\nSet the `NSContactsUsageDescription` in your `Info.plist` file  \n  \n```xml  \n\u003ckey\u003eNSContactsUsageDescription\u003c/key\u003e  \n\u003cstring\u003eThis app requires contacts access to function properly.\u003c/string\u003e  \n```  \n\n**Note**  \n`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](https://github.com/AppleEducate/flutter_simple_permissions)  or [permission_handler](https://pub.dartlang.org/packages/permission_handler).\n  \nIf 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.   \n  \n## Example  \n\n```dart  \n// Import package  \nimport 'package:contacts_service/contacts_service.dart';  \n  \n// Get all contacts on device\nList\u003cContact\u003e contacts = await ContactsService.getContacts();  \n\n// Get all contacts without thumbnail (faster)\nList\u003cContact\u003e contacts = await ContactsService.getContacts(withThumbnails: false);\n\n// Android only: Get thumbnail for an avatar afterwards (only necessary if `withThumbnails: false` is used)\nUint8List avatar = await ContactsService.getAvatar(contact);\n  \n// Get contacts matching a string\nList\u003cContact\u003e johns = await ContactsService.getContacts(query : \"john\");\n\n// Add a contact  \n// The contact must have a firstName / lastName to be successfully added  \nawait ContactsService.addContact(newContact);  \n  \n// Delete a contact\n// The contact must have a valid identifier\nawait ContactsService.deleteContact(contact);  \n\n// Update a contact\n// The contact must have a valid identifier\nawait ContactsService.updateContact(contact);\n\n// Usage of the native device form for creating a Contact\n// Throws a error if the Form could not be open or the Operation is canceled by the User\nawait ContactsService.openContactForm();\n\n// Usage of the native device form for editing a Contact\n// The contact must have a valid identifier\n// Throws a error if the Form could not be open or the Operation is canceled by the User\nawait ContactsService.openExistingContact(contact);\n\n```  \n\n**Contact Model**\n```dart\n// Name\nString displayName, givenName, middleName, prefix, suffix, familyName;\n\n// Company\nString company, jobTitle;\n\n// Email addresses\nList\u003cItem\u003e emails = [];\n\n// Phone numbers\nList\u003cItem\u003e phones = [];\n\n// Post addresses\nList\u003cPostalAddress\u003e postalAddresses = [];\n\n// Contact avatar/thumbnail\nUint8List avatar;\n\n```\n  \n![Example](doc/example.gif \"Example screenshot\")  \n  \n## Contributions\n\nContributions are welcome! If you find a bug or want a feature, please fill an issue.\n\nIf you want to contribute code please create a pull request under the staging branch.\n\n## Credits\n\nHeavily inspired from rt2zz's react native [plugin](https://github.com/rt2zz/react-native-contacts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukasgit%2Fflutter_contacts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukasgit%2Fflutter_contacts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukasgit%2Fflutter_contacts/lists"}