SunnyApp / flutter_contact

A flutter plugin for retrieving, creating, saving, and watching contacts on native devices
BSD 3-Clause "New" or "Revised" License
80 stars 62 forks source link

label for dates on Android #56

Closed Billy-80 closed 3 years ago

Billy-80 commented 3 years ago

Hello, on Android when using Contacts.updateContact(contact); , the labels for dates are changed / duplicated ( see the screenshot). The plugin update function after deletion and at insertion is done with date.label (.withTypeAndLabel(ItemType.event, date.label), this seems to modify the existing labels for birthday , even when the string is passed as 'Birthday' with an upper case 'B', this is still perceived by Android as a user custom label text.

Also if the contact had an anniversary event date already set, after update the anniversary duplicates the event due to the label mismatch. This can be reproduced by updating a field for an existing contact ( any field) which already has a date set for an event on android 10 or 11 emulator.

According to the link ,it seems that the type of data needs to be passed as an integer ( like EVENT.LABEL.TYPE_BIRTHDAY for instance).

Screenshot 2021-04-08 at 12 24 40

ericmartineau commented 3 years ago

Fixed - the reverse type mapping was a copy/paste mistake and hadn't been updated. Should be fixed in: flutter_contact: ^0.9.1+6