add two decimal and add confirm dialog if press back button
This commit is contained in:
@@ -40,7 +40,7 @@ class _DiscountEditorState extends State<DiscountEditor> {
|
||||
if (widget.discount != null) {
|
||||
_discount = widget.discount;
|
||||
_codeController.text = _discount.code;
|
||||
_amountController.text = _discount.amount.toString();
|
||||
_amountController.text = _discount.amount.toStringAsFixed(2);
|
||||
_statusController.text = _discount.status;
|
||||
customerName = widget.discount.customerName;
|
||||
customerId = widget.discount.customerId;
|
||||
@@ -97,7 +97,11 @@ class _DiscountEditorState extends State<DiscountEditor> {
|
||||
),
|
||||
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,
|
||||
actions: [
|
||||
|
||||
Reference in New Issue
Block a user