add two decimal and add confirm dialog if press back button
This commit is contained in:
@@ -32,7 +32,7 @@ class _CargoEditorState extends State<CargoEditor> {
|
||||
if (widget.cargo != null) {
|
||||
_cargo = widget.cargo;
|
||||
_descController.text = _cargo.name;
|
||||
_rateController.text = _cargo.rate.toString();
|
||||
_rateController.text = _cargo.rate.toStringAsFixed(2);
|
||||
} else {
|
||||
_isNew = true;
|
||||
}
|
||||
@@ -60,7 +60,11 @@ class _CargoEditorState extends State<CargoEditor> {
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
onPressed: () {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
},
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("cargo.form.title")),
|
||||
|
||||
Reference in New Issue
Block a user