diff --git a/lib/pages/carton/carton_info.dart b/lib/pages/carton/carton_info.dart index 78ae425..4a9d997 100644 --- a/lib/pages/carton/carton_info.dart +++ b/lib/pages/carton/carton_info.dart @@ -61,15 +61,19 @@ class _CartonInfoState extends State { bool isSmallBag = false; bool isFromCartons = false; bool isEdiable = false; + bool isCutomDuty=false; final List cargoTypes = []; final List surchareItems = []; + final List cartons = []; @override void initState() { super.initState(); _box = widget.box; _box?.billToValue = "Bill to sender"; - _cartonSubmit = widget.cartonSubmit; + + + //initPackage(widget.package!); //for shipment weight @@ -206,6 +210,9 @@ class _CartonInfoState extends State { final packageBox = DisplayText( labelTextKey: "box.package", ); + final cartonBox = DisplayText( + labelTextKey: "box.shipment.boxes", + ); final cargosBox = Padding( padding: const EdgeInsets.only(top: 10), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -330,43 +337,7 @@ class _CartonInfoState extends State { controller: multiImgController, title: "Receipt File", ); - final displayMixBox = Container( - child: Row( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: Row( - //crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - customerNameBox, - ], - ), - ), - _box?.billToValue == billToSender - ? Expanded( - child: Padding( - padding: EdgeInsets.only(left: 0, top: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Icon(Ionicons.document_text_outline, - color: primaryColor, size: 20), - Text("Bill to", - style: TextStyle( - color: primaryColor, fontSize: 15)) - ], - ))) - : const SizedBox() - ], - ), - ), - Expanded( + final consigneeBox=Container( child: Padding( padding: const EdgeInsets.only(left: 0), child: Row( @@ -397,15 +368,39 @@ class _CartonInfoState extends State { : const SizedBox() ], ), - )) - ], - ), - packageBox, - Row( - children: getPackageList(_box!.packages), - ) - ], - )); + )); + final customerBox= Container( + child: Row( + //crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + customerNameBox, + ], + ), + ), + _box?.billToValue == billToSender + ? Expanded( + child: Padding( + padding: EdgeInsets.only(left: 0, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon(Ionicons.document_text_outline, + color: primaryColor, size: 20), + Text("Bill to", + style: TextStyle( + color: primaryColor, fontSize: 15)) + ], + ))) + : const SizedBox() + ], + ), + ); + + final billWidget = Expanded( child: Padding( padding: EdgeInsets.only(left: 0, top: 15), @@ -460,58 +455,82 @@ class _CartonInfoState extends State { ), ], ), + // isMixBox + // ? + // displayMixBox:Container(), + + isMixBox? + - // Row( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Expanded( - // child: Row( - // //crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Expanded( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // customerNameBox, - // ], - // ), - // ), - // _box?.billToValue == billToSender - // ? billWidget - // : const SizedBox() - // ], - // ), - // ), - // Expanded( - // child: Padding( - // padding: const EdgeInsets.only(left: 0), - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Expanded( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // consigneeNameBox, - // ], - // ), - // ), - // _cartonSubmit?.billToValue == billToSender - // ? billWidget - // : const SizedBox() - // ], - // ), - // )) - // ], - // ), - // packageBox, + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Row( + //crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + customerNameBox, + ], + ), + ), + _box?.billToValue == billToSender + ? billWidget + : const SizedBox( height: 300.0,) + ], + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(left: 0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + consigneeNameBox, + ], + ), + ), + _cartonSubmit?.billToValue == billToSender + ? billWidget + : const SizedBox() + ], + ), + )) + ], + ) + // , + // Row( // children: getPackageList(_box!.packages), // ), - // ]):Container(), - + // ]) + :Container(), + isMixBox ? + Column(children: [ + packageBox, + Row( + children: getPackageList(_box!.packages), + ), + ],):Column( + children: [ + cartonBox, + Row( + children: getCartonList(_box!.mixCartons), + ), + ], + ), + isCutomDuty + ? + surchargeItemBox: cargosBox, - surchargeItemBox, + Padding( padding: EdgeInsets.only(left: 200.0, right: 8.0), child: ElevatedButton( @@ -603,6 +622,17 @@ class _CartonInfoState extends State { )); }).toList(); } + List getCartonList(List _c) { + return _c.map((c) { + return Container( + padding: EdgeInsets.only(top: 0), + child: Container( + //padding: + //EdgeInsets.only(top: 0.0), + child: Row(children: [new Text(c.cartonNumber ?? '')]), + )); + }).toList(); + } List getCargoList(List _c) { return _c.map((c) {