搜索插件、代码仓与 APP 分类

fast_contacts 封面
插件详情v6.0.0

fast_contacts

一种更快地访问设备联系人列表的方法。可在合理的时间内获取整个联系人列表。

AndroidiOS
近 30 天下载
8万
喜欢数
120
Pub 分数
150

安装插件

flutter pub add fast_contacts

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

fast_contacts 是一个 Flutter 包,提供高性能的设备联系人列表访问解决方案。它使开发者能够高效地获取整个联系人数据库,与标准方法相比,显著减少了加载时间。该包设计简洁且快速,可无缝集成到 Android 和 iOS 应用中,提供一种可靠的方式来检索联系人数据,而不会产生过度延迟。该包非常适合需要快速访问用户联系人的应用程序,例如消息传递或社交网络应用。

适合场景

  • 快速获取所有联系人
  • 集成联系人搜索功能
  • 构建联系人选择器界面
  • 启用用户连接功能
  • 支持消息应用联系人列表

主要特点

  • 快速联系人检索
  • 跨平台支持(Android 和 iOS)
  • 简单的 API 集成
  • 高效的内存使用
  • 加载联系人时的最低延迟

适合对象

  • 联系人选择器实现
  • 需要快速联系人访问的应用
  • 用户入门与联系人导入
  • 社交或通信平台
  • 对性能敏感的联系人操作

使用建议

  • 需要在 Android 和 iOS 上具有适当的权限
  • 可能需要处理大型联系人数据集
  • 仅限基本联系信息(姓名、电话、电子邮件)
  • 不适用于实时联系人同步
  • 依赖原生平台联系人API

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

fast_contacts

Version Likes Points Downloads

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 single contact by ID
final contact = await FastContacts.getContact(contactId);

// Get contact's image (thumbnail)
final thumbnail = await FastContacts.getContactImage(contact.id);

// Get contact's image (full size)
final thumbnail = await FastContacts.getContactImage(contact.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

所属分类

源码仓库

使用此插件的项目