update contact

This commit is contained in:
tzw
2021-09-13 12:12:45 +06:30
parent 47069e7108
commit 1e6471e66c
2 changed files with 8 additions and 3 deletions

View File

@@ -33,9 +33,14 @@ class _ContactEditorState extends State<ContactEditor> {
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() {

View File

@@ -52,7 +52,7 @@ class _ContactPageState extends State<ContactPage> {
contact: Contact.fromSetting(setting)),
)),
icon: Icon(
CupertinoIcons.pen,
Icons.edit,
color: primaryColor,
))
]