Closed TomerPacific closed 2 months ago
Hi @TomerPacific - can you post the code you used?
@joachim-quis - I am getting contacts using this:
await FlutterContacts.getContacts();
and then I am iterating over the List
for (Contact contact in users) {
DateTime? chosenBirthDate = await showDatePicker(context: context,
initialDate: DateTime(1970, 1, 1),
firstDate: DateTime(1970, 1, 1),
lastDate: DateTime.now(),
initialEntryMode: DatePickerEntryMode.input,
helpText: "Choose birth date for ${contact.displayName}",
fieldLabelText: "${contact.displayName}'s birth date"
);
if (chosenBirthDate != null) {
UserBirthday userBirthday = new UserBirthday(contact.displayName,
chosenBirthDate,
true,
contact.phones.isNotEmpty ? contact.phones.first.number : "");
}
}
@joachim-quis - any update here? Also tried on a Pixel7 physical device and saw the same behavior.
@TomerPacific Try using this line " await FlutterContacts.getContacts(withProperties: true); " . Set "withProperties: true ". I tested it on real device.
@AbhishekSingh-958 - You are correct. This should be documented more clearly.
I am using flutter_contacts version 1.1.7+1 to handle importing contacts in my application.
When testing things out, I created a contact on an emulated device and have added two phone numbers to it.
Then, when importing the contact, I see that the phones attribute under the Contact object is empty.
What could be the cause of this?
You can also see that the isStarred attribute is marked as true, even though that is not true for the contact.
The emulated device I am using is a Pixel 4 with API 29