check null safety
This commit is contained in:
@@ -33,7 +33,7 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
super.initState();
|
||||
if (widget.custom != null) {
|
||||
_custom = widget.custom!;
|
||||
_productController.text = _custom.name;
|
||||
_productController.text = _custom.name??"";
|
||||
_feeController.text = _custom.customDutyFee.toStringAsFixed(2);
|
||||
_shipmentRateController.text =
|
||||
_custom.rate == null ? "" : _custom.rate.toStringAsFixed(2);
|
||||
@@ -154,7 +154,7 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
try {
|
||||
var shipmentRateModel =
|
||||
Provider.of<ShipmentRateModel>(context, listen: false);
|
||||
await shipmentRateModel.deleteCustomDuty(this._custom.id);
|
||||
await shipmentRateModel.deleteCustomDuty(this._custom.id!);
|
||||
Navigator.pop(context);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
|
||||
Reference in New Issue
Block a user