null safety
This commit is contained in:
@@ -61,16 +61,16 @@ class InvoiceTable extends StatelessWidget {
|
||||
List<InvoiceTableRow> getTableRows() {
|
||||
List<InvoiceTableRow> tableRows = [];
|
||||
// add cargo types
|
||||
List<CargoType> _cargoTypes = invoice!.getCargoTypes(rate!) ?? [];
|
||||
List<CargoType> _cargoTypes = invoice!.getCargoTypes(rate!);
|
||||
_cargoTypes.forEach((c) {
|
||||
tableRows.add(InvoiceTableRow(
|
||||
invoiceDataType: InvoiceDataType.CargoDataType,
|
||||
desc: c.name,
|
||||
rate:
|
||||
"${c.calWeight!.toStringAsFixed(2)} x ${c.calRate!.toStringAsFixed(2)}",
|
||||
"${c.calWeight.toStringAsFixed(2)} x ${c.calRate.toStringAsFixed(2)}",
|
||||
amount: "${c.calAmount.toStringAsFixed(2)}"));
|
||||
});
|
||||
invoice!.shipments.where((ss) => (ss.isSelected ?? false)).forEach((s) {
|
||||
invoice!.shipments.where((ss) => (ss.isSelected )).forEach((s) {
|
||||
tableRows.add(InvoiceTableRow(
|
||||
data: s,
|
||||
invoiceDataType: InvoiceDataType.HandlingFeeType,
|
||||
@@ -95,7 +95,7 @@ class InvoiceTable extends StatelessWidget {
|
||||
invoiceDataType: InvoiceDataType.DeliveryFeeType,
|
||||
desc: "Delivery fee",
|
||||
rate: "",
|
||||
amount: "${invoice?.deliveryFee?.toStringAsFixed(2) ?? '0'}"));
|
||||
amount: "${invoice?.deliveryFee.toStringAsFixed(2) ?? '0'}"));
|
||||
|
||||
// // add discounts
|
||||
if (invoice!.discount != null) {
|
||||
@@ -104,7 +104,7 @@ class InvoiceTable extends StatelessWidget {
|
||||
invoiceDataType: InvoiceDataType.DiscountDataType,
|
||||
desc: "Discount\n${invoice?.discount?.code ?? ""}",
|
||||
rate: "",
|
||||
amount: "(${invoice?.discount?.amount?.toStringAsFixed(2) ?? ''})"));
|
||||
amount: "(${invoice?.discount?.amount.toStringAsFixed(2) ?? ''})"));
|
||||
}
|
||||
|
||||
return tableRows;
|
||||
|
||||
Reference in New Issue
Block a user