简体   繁体   中英

Change phone number of contact with contacts_service in Flutter

If i do the following:

widget.contact.phones.elementAt(1).value = "023492034902";

Flutter/Dart doesn't throw me an error, but the value is not changed to my defined String. I know how to edit the contacts name programmatically but as phones is an Iterable I don't know how to change a specific value.

Have you tried updating the contact using this line of code?

await ContactsService.updateContact(contact);

I think it should change the contact from its identifier, so you just update the contact that already existed.

I got the code from the example here https://pub.dev/packages/contacts_service

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM