fix number formatting
This commit is contained in:
@@ -8,9 +8,11 @@ import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
typedef OnDiscountSelected(Discount discount);
|
||||
typedef OnDeliveryFeeSelected(bool selected);
|
||||
final formatter = new NumberFormat("#,###.00");
|
||||
|
||||
class InvoiceCargoTable extends StatelessWidget {
|
||||
final Invoice invoice;
|
||||
@@ -46,10 +48,11 @@ class InvoiceCargoTable extends StatelessWidget {
|
||||
Expanded(flex: 2, child: Text('${cargo.name}')),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('${cargo.calWeight} x ${cargo.calRate}',
|
||||
child: Text(
|
||||
'${cargo.calWeight.toStringAsFixed(2)} x ${cargo.calRate.toStringAsFixed(2)}',
|
||||
textAlign: TextAlign.center)),
|
||||
Expanded(
|
||||
child: Text('\$ $amount',
|
||||
child: Text('\$ ${amount.toStringAsFixed(2)}',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
@@ -118,7 +121,7 @@ class InvoiceCargoTable extends StatelessWidget {
|
||||
SizedBox(width: 40),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'\$ $total',
|
||||
'\$ ${total.toStringAsFixed(2)}',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.end,
|
||||
))
|
||||
@@ -155,12 +158,13 @@ class InvoiceCargoTable extends StatelessWidget {
|
||||
}
|
||||
}),
|
||||
Expanded(
|
||||
child: Text('\$ ( ${invoice.getDiscount()} )',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
)))
|
||||
child:
|
||||
Text('\$ ( ${invoice.getDiscount().toStringAsFixed(2)} )',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
)))
|
||||
],
|
||||
),
|
||||
));
|
||||
@@ -185,7 +189,7 @@ class InvoiceCargoTable extends StatelessWidget {
|
||||
),
|
||||
SizedBox(width: 40),
|
||||
Expanded(
|
||||
child: Text('\$ ${invoice.getCustomFee()}',
|
||||
child: Text('\$ ${invoice.getCustomFee().toStringAsFixed(2)}',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
@@ -215,7 +219,8 @@ class InvoiceCargoTable extends StatelessWidget {
|
||||
),
|
||||
SizedBox(width: 50),
|
||||
Expanded(
|
||||
child: Text('\$ ${invoice.handlingFee?.toString() ?? ""}',
|
||||
child: Text(
|
||||
'\$ ${invoice.getHandlingFee().toStringAsFixed(2) ?? ""}',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
@@ -253,12 +258,13 @@ class InvoiceCargoTable extends StatelessWidget {
|
||||
activeColor: primaryColor,
|
||||
),
|
||||
Expanded(
|
||||
child: Text('\$ ${invoice.getDeliveryFee()}',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
)))
|
||||
child:
|
||||
Text('\$ ${invoice.getDeliveryFee().toStringAsFixed(2)}',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
)))
|
||||
],
|
||||
),
|
||||
));
|
||||
@@ -297,7 +303,8 @@ class InvoiceCargoTable extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text('\$ ${invoice.getNetAmount(rate)}',
|
||||
child: Text(
|
||||
'\$ ${invoice.getNetAmount(rate).toStringAsFixed(2)}',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
@@ -327,7 +334,8 @@ class InvoiceCargoTable extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text('\$ ${invoice.getTotalBalance(rate)}',
|
||||
child: Text(
|
||||
'\$ ${invoice.getTotalBalance(rate).toStringAsFixed(2)}',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
|
||||
Reference in New Issue
Block a user