From 1e6471e66cca4db9ba19f071ddb289a17b7c2928 Mon Sep 17 00:00:00 2001 From: tzw Date: Mon, 13 Sep 2021 12:12:45 +0630 Subject: [PATCH] update contact --- lib/pages/contact/contact_editor.dart | 9 +++++++-- lib/pages/contact/contact_page.dart | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/pages/contact/contact_editor.dart b/lib/pages/contact/contact_editor.dart index 8092c2f..f292008 100644 --- a/lib/pages/contact/contact_editor.dart +++ b/lib/pages/contact/contact_editor.dart @@ -33,9 +33,14 @@ class _ContactEditorState extends State { Contact? _contact; @override void initState() { - if (widget.contact != null) _contact = widget.contact!; super.initState(); - isNew = widget.contact == null; + if (widget.contact != null) { + isNew = false; + _contact = widget.contact; + initContact(); + } else { + isNew = true; + } } initContact() { diff --git a/lib/pages/contact/contact_page.dart b/lib/pages/contact/contact_page.dart index f0c1fae..ed56946 100644 --- a/lib/pages/contact/contact_page.dart +++ b/lib/pages/contact/contact_page.dart @@ -52,7 +52,7 @@ class _ContactPageState extends State { contact: Contact.fromSetting(setting)), )), icon: Icon( - CupertinoIcons.pen, + Icons.edit, color: primaryColor, )) ]