getContact method
Fetches one contact.
By default everything available is fetched. If withProperties
is
false, properties (phones, emails, addresses, websites, etc) won't be
fetched.
If withThumbnail
is false, the low-resolution thumbnail won't be
fetched. If withPhoto
is false, the high-resolution photo won't be
fetched.
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<Contact> getContact(
String id, {
bool withProperties = true,
bool withThumbnail = true,
bool withPhoto = true,
bool deduplicateProperties = true,
}) async {
final contacts = await _select(
id: id,
withProperties: withProperties,
withThumbnail: withThumbnail,
withPhoto: withPhoto,
sorted: false,
deduplicateProperties: deduplicateProperties,
);
if (contacts.length != 1) return null;
return contacts.first;
}