check null safety

This commit is contained in:
tzw
2021-09-10 16:33:52 +06:30
parent 3eacbef117
commit d8c86a512b
46 changed files with 275 additions and 304 deletions

View File

@@ -1,5 +1,4 @@
import 'package:fcs/domain/entities/cargo_type.dart';
import 'package:fcs/domain/entities/custom_duty.dart';
import 'package:fcs/domain/entities/discount_by_weight.dart';
import 'package:fcs/domain/entities/rate.dart';
import 'package:fcs/helpers/theme.dart';
@@ -185,8 +184,8 @@ class _ShipmentRatesState extends State<ShipmentRates> {
List<Widget> getCargoWidget(List<CargoType> cargos) {
return cargos.map((cargo) {
return Container(
child: _row(
cargo.name, "\$ " + cargo.rate.toStringAsFixed(2), 'per pound'),
child: _row(cargo.name ?? "", "\$ " + cargo.rate.toStringAsFixed(2),
'per pound'),
);
}).toList();
}
@@ -194,7 +193,8 @@ class _ShipmentRatesState extends State<ShipmentRates> {
List<Widget> getCustonWidget(List<CargoType> customs) {
return customs.map((c) {
return Container(
child: _row(c.name, "\$ " + c.customDutyFee.toStringAsFixed(2), ''),
child:
_row(c.name ?? "", "\$ " + c.customDutyFee.toStringAsFixed(2), ''),
);
}).toList();
}