update contact
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -52,7 +52,7 @@ class _ContactPageState extends State<ContactPage> {
|
||||
contact: Contact.fromSetting(setting)),
|
||||
)),
|
||||
icon: Icon(
|
||||
CupertinoIcons.pen,
|
||||
Icons.edit,
|
||||
color: primaryColor,
|
||||
))
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user