diff --git a/lib/pages/carton/carton_info.dart b/lib/pages/carton/carton_info.dart index c716703..7ae1d9f 100644 --- a/lib/pages/carton/carton_info.dart +++ b/lib/pages/carton/carton_info.dart @@ -315,29 +315,8 @@ class _CartonInfoState extends State { child: LocalText(context, "box.imageupload.title", color: Colors.white, fontSize: 14)), ); - final shipBtn = Padding( - padding: const EdgeInsets.symmetric(horizontal: 30), - child: LocalButton( - color: primaryColor, - textKey: "box.ship.btn", - callBack: _ship, - )); - final arriveBtn = Padding( - padding: const EdgeInsets.symmetric(horizontal: 30), - child: LocalButton( - color: primaryColor, - textKey: "box.arrive.btn", - callBack: _arrive, - )); - final invoiceBtn = Padding( - padding: const EdgeInsets.symmetric(horizontal: 30), - child: LocalButton( - color: primaryColor, - textKey: "box.invoice.btn", - callBack: _invoice, - )); - - final deleteBtn = Padding( + + final deleteBtn = Padding( padding: const EdgeInsets.symmetric(horizontal: 30), child: LocalButton( color: dangerColor, @@ -421,19 +400,7 @@ class _CartonInfoState extends State { const SizedBox(height: 30), img, const SizedBox(height: 40), - _carton.status == carton_processing_status - ? shipBtn - : Container(), - const SizedBox(height: 40), - _carton.status == carton_processing_status - ? deleteBtn - : Container(), - _carton.status == carton_arrived_status - ? arriveBtn - : Container(), - _carton.status == carton_arrived_status - ? invoiceBtn - : Container(), + deleteBtn, const SizedBox(height: 20) ])))); } @@ -479,80 +446,7 @@ class _CartonInfoState extends State { _init(); } } - - _ship() { - showConfirmDialog(context, "box.ship.confirm", () { - _shipCarton(); - }); - } - - _shipCarton() async { - setState(() { - _isLoading = true; - }); - try { - // CartonModel cartonModel = - // Provider.of(context, listen: false); - //await cartonModel.ship(_carton.id!); - Navigator.pop(context, true); - } catch (e) { - showMsgDialog(context, "Error", e.toString()); - } finally { - setState(() { - _isLoading = false; - }); - } - } - - _arrive() { - showConfirmDialog(context, "box.arrive.confirm", () { - _arriveCarton(); - }); - } - - _arriveCarton() async { - setState(() { - _isLoading = true; - }); - try { - // CartonModel cartonModel = - // Provider.of(context, listen: false); - //await cartonModel.ship(_carton.id!); - Navigator.pop(context, true); - } catch (e) { - showMsgDialog(context, "Error", e.toString()); - } finally { - setState(() { - _isLoading = false; - }); - } - } - - _invoice() { - showConfirmDialog(context, "box.invoice.confirm", () { - _invoiceCarton(); - }); - } - - _invoiceCarton() async { - setState(() { - _isLoading = true; - }); - try { - // CartonModel cartonModel = - // Provider.of(context, listen: false); - //await cartonModel.ship(_carton.id!); - Navigator.pop(context, true); - } catch (e) { - showMsgDialog(context, "Error", e.toString()); - } finally { - setState(() { - _isLoading = false; - }); - } - } - - _delete() { + _delete() { showConfirmDialog(context, "box.delete.confirm", () { _deleteCarton(); });