selectContacts method
Implementation
Future<String?> selectContacts() async {
/// Check contact permission
if (Platform.isAndroid) {
if (!(await UFUtils.permissionUtils.getContactsPermission())) {
if(await Permission.contacts.status.isPermanentlyDenied) {
// UFUtils.hideLoaderDialog();
await permissionDeniedDialogue();
}
return null;
}
}
Contact? selectedContact = await FlutterNativeContactPicker().selectContact();
if (selectedContact != null) {
ContactModel? contact = ContactModel.fromContacts(selectedContact);
return jsonEncode(contact.toJson());
}
return null;
}