update shipment type
This commit is contained in:
@@ -159,7 +159,9 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
|
||||
color: dangerColor,
|
||||
textKey: "FCSshipment.cancel.btn",
|
||||
callBack: () {
|
||||
showConfirmDialog(context, "FCSshipment.cancel.confirm", () {});
|
||||
showConfirmDialog(context, "FCSshipment.cancel.confirm", () {
|
||||
_cancelFcsShipment();
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -174,10 +176,12 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.edit, color: primaryColor),
|
||||
onPressed: _edit,
|
||||
),
|
||||
_fcsShipment?.status == fcs_shipment_pending_status
|
||||
? IconButton(
|
||||
icon: Icon(Icons.edit, color: primaryColor),
|
||||
onPressed: _edit,
|
||||
)
|
||||
: const SizedBox(),
|
||||
//menuPopWidget(context)
|
||||
],
|
||||
),
|
||||
@@ -377,6 +381,24 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
|
||||
}
|
||||
}
|
||||
|
||||
_cancelFcsShipment() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
FcsShipmentModel fcsShipmentModel =
|
||||
Provider.of<FcsShipmentModel>(context, listen: false);
|
||||
await fcsShipmentModel.cancel(_fcsShipment!.id!);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_showPDF(int id) async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
|
||||
Reference in New Issue
Block a user