diff --git a/lib/pages/box/box_editor.dart b/lib/pages/box/box_editor.dart index edf261b..4761a54 100644 --- a/lib/pages/box/box_editor.dart +++ b/lib/pages/box/box_editor.dart @@ -500,26 +500,22 @@ class _BoxEditorState extends State { widget.box == null ? Container() : Center(child: nameWidget(_box.packageNumber)), - Container( - padding: EdgeInsets.only(top: 10), - child: TitleWithAddButton( - titleKey: "box.shipment_info", - ), + SizedBox( + height: 10, ), - Column( - children: [ - shipmentBox, - SizedBox( - height: 10, - ), - fcsIDBox, - phoneNumberBox, - namebox, - mixBox, - SizedBox( - height: 10, - ), - ], + TitleWithAddButton( + titleKey: "box.shipment_info", + ), + shipmentBox, + SizedBox( + height: 10, + ), + fcsIDBox, + phoneNumberBox, + namebox, + mixBox, + SizedBox( + height: 10, ), Divider(), Container( @@ -582,15 +578,11 @@ class _BoxEditorState extends State { TitleWithAddButton( titleKey: "box.dimension", ), - Column( - children: [ - shipmentWeightBox, - widthBox, - heightBox, - lengthBox, - SizedBox(height: 25), - ], - ), + shipmentWeightBox, + widthBox, + heightBox, + lengthBox, + SizedBox(height: 25), Divider(), Container( padding: EdgeInsets.only(left: 10, right: 10), diff --git a/lib/pages/invoice/invoice_editor.dart b/lib/pages/invoice/invoice_editor.dart index c8adcf2..51af84d 100644 --- a/lib/pages/invoice/invoice_editor.dart +++ b/lib/pages/invoice/invoice_editor.dart @@ -18,6 +18,7 @@ import 'package:fcs/pages/widgets/display_text.dart'; import 'package:fcs/pages/widgets/input_text.dart'; import 'package:fcs/pages/widgets/local_dropdown.dart'; import 'package:fcs/pages/widgets/local_text.dart'; +import 'package:fcs/pages/widgets/local_title.dart'; import 'package:fcs/pages/widgets/multi_img_controller.dart'; import 'package:fcs/pages/widgets/multi_img_file.dart'; import 'package:fcs/pages/widgets/my_data_table.dart'; @@ -196,181 +197,141 @@ class _InvoiceEditorState extends State { title: LocalText(context, 'invoice.form.title', color: primaryColor, fontSize: 20), ), - body: Card( - child: Column( + body: Padding( + padding: const EdgeInsets.all(8.0), + child: ListView( children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(10.0), - child: ListView(children: [ - DisplayText( - labelTextKey: 'invoice.date', - iconData: Icons.date_range, - text: _dateController.text), - widget.invoice == null - ? Container() - : DisplayText( - labelTextKey: 'invoice.number', - iconData: FontAwesomeIcons.fileInvoice, - text: _invoiceNumberController.text), - widget.invoice == null - ? Row( - children: [ - Expanded( - child: DisplayText( - text: user != null ? user.name : "", - labelTextKey: "invoice.customer_name", - iconData: Feather.user, - )), - IconButton( - icon: Icon(Icons.search, color: primaryColor), - onPressed: () => searchUser(context, - callbackUserSelect: (u) { - setState(() { - this.user = u; - }); - })), - ], - ) - : DisplayText( - text: _nameController.text, - iconData: Feather.user, - labelTextKey: 'invoice.customer_name'), - InputText( - controller: _handlingFeeController, - iconData: FontAwesomeIcons.moneyBill, - labelTextKey: 'invoice.handling_fee'), - SizedBox(height: 15), - discountBox, - widget.invoice == null - ? Container() - : DisplayText( - text: _statusController.text, - iconData: Icons.av_timer, - labelTextKey: 'invoice.status'), - SizedBox(height: 30), - Container( - child: Row( - children: [ - Icon(MaterialCommunityIcons.package, - color: primaryColor), - SizedBox(width: 10), - LocalText( - context, - "invoice.box_info", - color: Colors.grey, - fontSize: 20, - fontWeight: FontWeight.w700, - ), - ], - ), - ), - Container( - padding: const EdgeInsets.only(top: 15), - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: MyDataTable( - headingRowHeight: 40, - columnSpacing: 20, - columns: [ - MyDataColumn( - label: Text(''), - ), - MyDataColumn( - label: LocalText( - context, - "invoice.box.number", - color: Colors.grey, - ), - ), - MyDataColumn( - label: Text( - getLocalString(context, "invoice.box.length") + - ' x ' + - getLocalString(context, "invoice.box.width") + - ' x ' + - getLocalString(context, "invoice.box.height"), - ), - ), - ], - rows: getBoxRow(context), - ), - ), - ), - SizedBox(height: 40), - Container( - child: Row( - children: [ - Icon(MaterialCommunityIcons.briefcase_check, - color: primaryColor), - SizedBox(width: 10), - LocalText( - context, - "invoice.cargo_type", - color: Colors.grey, - fontSize: 20, - fontWeight: FontWeight.w700, - ), - ], - ), - ), - Container( - padding: const EdgeInsets.only(top: 10), - child: Column(children: getCargoTableByBox(context)), - ), - SizedBox(height: 20), - Container( - padding: EdgeInsets.only(top: 5, left: 18), - child: Row( + LocalTitle(textKey: "package.create.name"), + DisplayText( + labelTextKey: 'invoice.date', + iconData: Icons.date_range, + text: _dateController.text), + widget.invoice == null + ? Container() + : DisplayText( + labelTextKey: 'invoice.number', + iconData: FontAwesomeIcons.fileInvoice, + text: _invoiceNumberController.text), + widget.invoice == null + ? Row( children: [ Expanded( - child: LocalText(context, 'invoice.payment_method', - fontSize: 16, - color: Colors.grey, - fontWeight: FontWeight.bold), - ), + child: DisplayText( + text: user != null ? user.name : "", + labelTextKey: "invoice.customer_name", + iconData: Feather.user, + )), + IconButton( + icon: Icon(Icons.search, color: primaryColor), + onPressed: () => + searchUser(context, callbackUserSelect: (u) { + setState(() { + this.user = u; + }); + })), + ], + ) + : DisplayText( + text: _nameController.text, + iconData: Feather.user, + labelTextKey: 'invoice.customer_name'), + InputText( + controller: _handlingFeeController, + iconData: FontAwesomeIcons.moneyBill, + labelTextKey: 'invoice.handling_fee'), + SizedBox(height: 15), + discountBox, + widget.invoice == null + ? Container() + : DisplayText( + text: _statusController.text, + iconData: Icons.av_timer, + labelTextKey: 'invoice.status'), + SizedBox(height: 30), + LocalTitle(textKey: "invoice.box_info"), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: MyDataTable( + headingRowHeight: 40, + // columnSpacing: 20, + columns: [ + MyDataColumn( + label: Text(''), + ), + MyDataColumn( + label: LocalText( + context, + "invoice.box.number", + color: Colors.grey, + ), + ), + MyDataColumn( + label: Text( + getLocalString(context, "invoice.box.length") + + ' x ' + + getLocalString(context, "invoice.box.width") + + ' x ' + + getLocalString(context, "invoice.box.height"), + ), + ), + ], + rows: getBoxRow(context), + ), + ), + SizedBox(height: 40), + LocalTitle(textKey: "invoice.cargo_type"), + Column(children: getCargoTableByBox(context)), + SizedBox(height: 20), + Container( + padding: EdgeInsets.only(top: 5, left: 18), + child: Row( + children: [ + Expanded( + child: LocalText(context, 'invoice.payment_method', + fontSize: 16, + color: Colors.grey, + fontWeight: FontWeight.bold), + ), + Container( + width: 150.0, + child: DropdownButtonFormField( + icon: Icon(Icons.edit), + value: paymentMethod, + items: paymentMethodModel.paymentMethods + .map((e) => DropdownMenuItem( + child: Text(e.name), value: e.name)) + .toList(), + onChanged: (selected) => {}, + ), + ), + ], + ), + ), + SizedBox(height: 30), + !isNew + ? Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Container( - width: 150.0, - child: DropdownButtonFormField( - icon: Icon(Icons.edit), - value: paymentMethod, - items: paymentMethodModel.paymentMethods - .map((e) => DropdownMenuItem( - child: Text(e.name), value: e.name)) - .toList(), - onChanged: (selected) => {}, + child: Row( + children: [ + Icon(Icons.receipt, color: primaryColor), + SizedBox(width: 10), + LocalText( + context, + "invoice.payment_attachment", + color: Colors.grey, + fontSize: 20, + fontWeight: FontWeight.w700, + ), + ], ), ), + Spacer(), + Icon(Icons.add, color: primaryColor), ], - ), - ), - SizedBox(height: 30), - !isNew - ? Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Row( - children: [ - Icon(Icons.receipt, color: primaryColor), - SizedBox(width: 10), - LocalText( - context, - "invoice.payment_attachment", - color: Colors.grey, - fontSize: 20, - fontWeight: FontWeight.w700, - ), - ], - ), - ), - Spacer(), - Icon(Icons.add, color: primaryColor), - ], - ) - : Container() - ]), - )), + ) + : Container(), widget.invoice == null ? fcsButton( context, getLocalString(context, 'invoice.btn_create')) diff --git a/lib/pages/shipment/shipment_box_editor.dart b/lib/pages/shipment/shipment_box_editor.dart index 9bfa4fb..43df1a0 100644 --- a/lib/pages/shipment/shipment_box_editor.dart +++ b/lib/pages/shipment/shipment_box_editor.dart @@ -71,7 +71,6 @@ class _ShipmentBoxEditorState extends State { double l = double.parse(_lengthCtl.text, (s) => 0); double w = double.parse(_widthCtl.text, (s) => 0); double h = double.parse(_heightCtl.text, (s) => 0); - print("$l $w $h"); setState(() { shipmentWeight = l * w * h / volumetricRatio; }); diff --git a/lib/pages/shipment/shipment_editor.dart b/lib/pages/shipment/shipment_editor.dart index 201261f..16320de 100644 --- a/lib/pages/shipment/shipment_editor.dart +++ b/lib/pages/shipment/shipment_editor.dart @@ -239,7 +239,6 @@ class _ShipmentEditorState extends State { }, ), ), - Column( children: getBoxList(context, boxModel.boxes), ),