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; Contact? _contact;
@override @override
void initState() { void initState() {
if (widget.contact != null) _contact = widget.contact!;
super.initState(); super.initState();
isNew = widget.contact == null; if (widget.contact != null) {
isNew = false;
_contact = widget.contact;
initContact();
} else {
isNew = true;
}
} }
initContact() { initContact() {

View File

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