getContacts static method

Future<List<Contact>> getContacts({
  1. String? query,
  2. bool withThumbnails = true,
  3. bool photoHighResolution = true,
  4. bool orderByGivenName = true,
  5. bool iOSLocalizedLabels = true,
  6. bool androidLocalizedLabels = true,
})

Fetches all contacts, or when specified, the contacts with a name matching query

Implementation

static Future<List<Contact>> getContacts(
    {String? query,
    bool withThumbnails = true,
    bool photoHighResolution = true,
    bool orderByGivenName = true,
    bool iOSLocalizedLabels = true,
    bool androidLocalizedLabels = true}) async {
  Iterable contacts =
      await _channel.invokeMethod('getContacts', <String, dynamic>{
    'query': query,
    'withThumbnails': withThumbnails,
    'photoHighResolution': photoHighResolution,
    'orderByGivenName': orderByGivenName,
    'iOSLocalizedLabels': iOSLocalizedLabels,
    'androidLocalizedLabels': androidLocalizedLabels,
  });
  return contacts.map((m) => Contact.fromMap(m)).toList();
}