getContactPhoto method
Future<void>
getContactPhoto(
- String id,
- ContactPhotoSuccessCallback onSuccess,
- ContactPhotoErrorCallback onError
override
Fetches a contact photo by contact identifier.
Implementation
@override
Future<void> getContactPhoto(String id, ContactPhotoSuccessCallback onSuccess,
ContactPhotoErrorCallback onError) async {
try {
final image = await fc.FastContacts.getContactImage(id);
if (image != null) {
onSuccess(image);
} else {
onError('Failed to fetch contact photo - ContactID: $id');
}
} catch (e) {
onError('Failed to fetch contact photo - Reason: $e');
}
}