add two decimal and add confirm dialog if press back button

This commit is contained in:
Thinzar Win
2020-12-04 17:28:21 +06:30
parent d5a3c4410e
commit 0b339e9dc1
32 changed files with 169 additions and 54 deletions

View File

@@ -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: [

View File

@@ -80,7 +80,7 @@ class DiscountListRow extends StatelessWidget {
child: Row(
children: <Widget>[
new Text(
"${discount.amount ?? ''}",
"${discount.amount.toStringAsFixed(2) ?? ''}",
style:
new TextStyle(fontSize: 15.0, color: Colors.grey),
),