From 2bbfcd23b9c09b5a1b9268fbb4e7db89a542e997 Mon Sep 17 00:00:00 2001 From: Oneya4 <1804612@students.kca.ac.ke> Date: Mon, 28 Apr 2025 14:26:13 +0300 Subject: [PATCH 1/2] Setting the correct type for notes onDelete() ans adding onUpdate() The _noteCard() in example_full\lib\pages\edit_contact_page.dart file erroneously points to _contact.groups for onDelete(). This throws an null/empty error when one adds a note and tries to delete it (as is). This fix ensures the notes property is the one targeted. Adding onUpdate() that was initially null --- example_full/lib/pages/edit_contact_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example_full/lib/pages/edit_contact_page.dart b/example_full/lib/pages/edit_contact_page.dart index 673213cd..00b6adbb 100644 --- a/example_full/lib/pages/edit_contact_page.dart +++ b/example_full/lib/pages/edit_contact_page.dart @@ -331,8 +331,8 @@ class _EditContactPageState extends State () => _contact.notes = _contact.notes + [Note('')], (int i, dynamic w) => NoteForm( w, - onUpdate: null, - onDelete: () => setState(() => _contact.groups.removeAt(i)), + onUpdate: (note) = _contacts.notes[i] = note, + onDelete: () => setState(() => _contact.notes.removeAt(i)), key: UniqueKey(), ), () => _contact.notes = [], From fd66bf8b78705ac69a529bd0bba7807b91b9ad8e Mon Sep 17 00:00:00 2001 From: Oneya4 <1804612@students.kca.ac.ke> Date: Mon, 28 Apr 2025 14:40:35 +0300 Subject: [PATCH 2/2] Setting correct PhoneLabel type for PhoneLabel.mobile Both iOS and Android support 'mobile' PhoneLabel. The current parser assigns type('cell') + ('text') or ('msg') which then miss-assigns the label when the contact is read or scanned. The current setup passes TEL;TYPE=cell,msg which is a custom label and not 'mobile' as intended. This PR fixes this by exclusively returning types.add('mobile') for PhoneLabel.mobile --- lib/properties/phone.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/properties/phone.dart b/lib/properties/phone.dart index 2f7f0c24..864f0a39 100644 --- a/lib/properties/phone.dart +++ b/lib/properties/phone.dart @@ -94,10 +94,12 @@ class Phone { types.add(v4 ? 'text' : 'msg'); break; case PhoneLabel.mms: - case PhoneLabel.mobile: types.add('cell'); types.add(v4 ? 'text' : 'msg'); break; + case PhoneLabel.mobile: + types.add('mobile'); + break; case PhoneLabel.workMobile: types.add('cell'); types.add(v4 ? 'text' : 'msg');