update contact
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
@@ -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,
|
||||||
))
|
))
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user