fix number formatting

This commit is contained in:
Sai Naw Wun
2020-10-22 05:27:03 +06:30
parent e5540c5491
commit bbacbd151a
5 changed files with 40 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
import 'package:fcs/domain/entities/carton.dart';
import 'package:fcs/domain/entities/package.dart';
import 'package:fcs/domain/entities/rate.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/local_title.dart';
@@ -11,8 +12,9 @@ typedef OnSelect = Function(Carton carton, bool checked);
class InvoiceCartonTable extends StatelessWidget {
final List<Carton> cartons;
final OnSelect onSelect;
final Rate rate;
const InvoiceCartonTable({Key key, this.cartons, this.onSelect})
const InvoiceCartonTable({Key key, this.cartons, this.onSelect, this.rate})
: super(key: key);
@override
@@ -88,6 +90,14 @@ class InvoiceCartonTable extends StatelessWidget {
"${p.value?.length ?? ""} x ${p.value?.width ?? ""} x ${p.value?.height ?? ""}",
style: textStyle,
),
new Text(
"${p.value?.getShipmentWeight(rate.volumetricRatio)?.toStringAsFixed(2) ?? "0"} lb",
style: textStyle,
),
new Text(
"${p.value?.actualWeight?.toStringAsFixed(2) ?? "0"} lb (Actual)",
style: textStyle,
),
],
),
)