null safety
This commit is contained in:
@@ -49,16 +49,19 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
||||
_isNew = widget.shipment == null;
|
||||
if (widget.shipment != null) {
|
||||
_shipment = widget.shipment!;
|
||||
_shipmentNumberController.text = _shipment.shipmentNumber;
|
||||
_cutoffDateController.text = dateFormatter.format(_shipment.cutoffDate);
|
||||
_arrivalDateController.text = dateFormatter.format(_shipment.arrivalDate);
|
||||
_shipmentNumberController.text = _shipment.shipmentNumber ?? "";
|
||||
if(_shipment.cutoffDate != null)
|
||||
_cutoffDateController.text = dateFormatter.format(_shipment.cutoffDate!);
|
||||
if(_shipment.arrivalDate != null)
|
||||
_arrivalDateController.text = dateFormatter.format(_shipment.arrivalDate!);
|
||||
if(_shipment.departureDate != null)
|
||||
_departureDateControler.text =
|
||||
dateFormatter.format(_shipment.departureDate);
|
||||
_statusController.text = _shipment.status;
|
||||
dateFormatter.format(_shipment.departureDate!);
|
||||
_statusController.text = _shipment.status ?? "";
|
||||
_currentShipmentType = _shipment.shipType;
|
||||
_consigneeController.text = _shipment.consignee;
|
||||
_portController.text = _shipment.port;
|
||||
_destinationController.text = _shipment.destination;
|
||||
_consigneeController.text = _shipment.consignee ?? "";
|
||||
_portController.text = _shipment.port ?? "";
|
||||
_destinationController.text = _shipment.destination ?? "";
|
||||
} else {
|
||||
var mainModel = Provider.of<MainModel>(context, listen: false);
|
||||
_currentShipmentType = mainModel.setting.shipmentTypes[0];
|
||||
|
||||
Reference in New Issue
Block a user