I use contact service to update my contacts, but it does not work, the contact number is remove. i use contact service contacts_service: ^0.4.6
Future updateContact(Contact contact, part) async{
Iterable<Item> phones = contact.phones;
List newPhones = [];
for(var phone in phones){
String newPhone;
if(part == 0) newPhone = "22489653214";
else newPhone = "22489653214";
newPhones.add(Item(label: phone.label, value: newPhone));
}
contact.phones = newPhones.map((e) => e);
await ContactsService.updateContact(contact);
}
question from:
https://stackoverflow.com/questions/65886060/how-to-update-contact-in-flutter 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…