getContacts static method
Fetches all contacts.
By default only ID and display name are fetched. If withProperties
is
true, properties (phones, emails, addresses, websites, etc) are also
fetched.
If withThumbnail
is true, the low-resolution thumbnail is also
fetched. If withPhoto
is true, the high-resolution photo is also
fetched.
If withGroups
is true, it also returns the group information (called
labels on Android and groups on iOS).
If withAccounts
is true, it also returns the account information. On
Android this is the raw account, and there can be several accounts per
unified contact (for example one for Gmail, one for Skype and one for
WhatsApp). On iOS it is called container, and there can be only one
container per contact.
If sorted
is true, the contacts are returned sorted by their
normalized display names (ignoring case and diacritics).
If deduplicateProperties
is true, the properties will be de-duplicated,
mainly to avoid the case (common on Android) where multiple equivalent
phones are returned.
Implementation
static Future<List<Contact>> getContacts({
bool withProperties = false,
bool withThumbnail = false,
bool withPhoto = false,
bool withGroups = false,
bool withAccounts = false,
bool sorted = true,
bool deduplicateProperties = true,
}) async =>
_select(
withProperties: withProperties,
withThumbnail: withThumbnail,
withPhoto: withPhoto,
withGroups: withGroups,
withAccounts: withAccounts,
sorted: sorted,
deduplicateProperties: deduplicateProperties,
);