getContactsForPhone static method
Fetches all contacts, or when specified, the contacts with the phone
matching phone
Implementation
static Future<List<Contact>> getContactsForPhone(String? phone,
{bool withThumbnails = true,
bool photoHighResolution = true,
bool orderByGivenName = true,
bool iOSLocalizedLabels = true,
bool androidLocalizedLabels = true}) async {
if (phone == null || phone.isEmpty) return List.empty();
Iterable contacts =
await _channel.invokeMethod('getContactsForPhone', <String, dynamic>{
'phone': phone,
'withThumbnails': withThumbnails,
'photoHighResolution': photoHighResolution,
'orderByGivenName': orderByGivenName,
'iOSLocalizedLabels': iOSLocalizedLabels,
'androidLocalizedLabels': androidLocalizedLabels,
});
return contacts.map((m) => Contact.fromMap(m)).toList();
}