add prompt confirmation and update carton

This commit is contained in:
Thinzar Win
2020-12-08 20:24:15 +06:30
parent 1a7b1ce97b
commit 20477b6915
39 changed files with 637 additions and 259 deletions

View File

@@ -29,17 +29,21 @@ class _ContactEditorState extends State<ContactEditor> {
TextEditingController _facebook = new TextEditingController();
bool _isLoading = false;
bool isNew;
@override
void initState() {
super.initState();
if (widget.contact != null) {
isNew = false;
_usaPhone.text = widget.contact.usaContactNumber;
_mmPhone.text = widget.contact.mmContactNumber;
_usaAddress.text = widget.contact.usaAddress;
_mmAddress.text = widget.contact.mmAddress;
_email.text = widget.contact.emailAddress;
_facebook.text = widget.contact.facebookLink;
} else {
isNew = true;
}
}
@@ -83,9 +87,7 @@ class _ContactEditorState extends State<ContactEditor> {
leading: new IconButton(
icon: new Icon(CupertinoIcons.back, color: primaryColor),
onPressed: () {
showConfirmDialog(context, "back.button_confirm", () {
Navigator.of(context).pop();
});
Navigator.of(context).pop();
}),
shadowColor: Colors.transparent,
backgroundColor: Colors.white,