搜尋套件、儲存庫與 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

所屬分類

原始碼儲存庫

使用此套件的專案