update carton form and add recent search
This commit is contained in:
@@ -151,6 +151,7 @@ class _CargoWidgetState extends State<CargoWidget> {
|
||||
);
|
||||
|
||||
final userRow = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: senderBox, flex: 2),
|
||||
Flexible(child: consigneeBox)
|
||||
@@ -265,7 +266,7 @@ class _CargoWidgetState extends State<CargoWidget> {
|
||||
_surchargeControllers.clear();
|
||||
_surchareItems.asMap().entries.forEach((e) {
|
||||
var editor = new TextEditingController();
|
||||
editor.text = e.value.qty == 0 ? "" : e.value.qty.toString();
|
||||
editor.text = e.value.qty.toString();
|
||||
_surchargeControllers.add(editor);
|
||||
});
|
||||
|
||||
@@ -314,6 +315,12 @@ class _CargoWidgetState extends State<CargoWidget> {
|
||||
final continueBtn = ContinueButton(
|
||||
onTap: () {
|
||||
if (widget.onContinue != null) {
|
||||
|
||||
if(_surchareItems.isNotEmpty && _surchareItems.any((item)=> item.qty == 0)){
|
||||
showMsgDialog(context, "Error", "Please insert surcharge item quantity");
|
||||
return;
|
||||
}
|
||||
|
||||
widget.onContinue!(_cargoTypes, _surchareItems);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -167,27 +167,33 @@ class _CartonFilterState extends State<CartonFilter> {
|
||||
|
||||
final _titleWidget = SizedBox(
|
||||
height: 30,
|
||||
child: TabBar(
|
||||
unselectedLabelColor: Colors.grey,
|
||||
labelColor: primaryColor,
|
||||
indicatorColor: primaryColor,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
labelPadding: const EdgeInsets.all(0),
|
||||
indicatorPadding: const EdgeInsets.all(0),
|
||||
tabs: [
|
||||
Tab(
|
||||
text: AppTranslations.of(context)?.text("box.fcs_shipment_num"),
|
||||
),
|
||||
Tab(
|
||||
text: AppTranslations.of(context)?.text("box.consignee.title"),
|
||||
),
|
||||
Tab(
|
||||
text: AppTranslations.of(context)?.text("box.sender.title"),
|
||||
),
|
||||
Tab(
|
||||
text: AppTranslations.of(context)?.text("box.status"),
|
||||
),
|
||||
],
|
||||
child: Theme(
|
||||
data: ThemeData(
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
),
|
||||
child: TabBar(
|
||||
unselectedLabelColor: Colors.grey,
|
||||
labelColor: primaryColor,
|
||||
indicatorColor: primaryColor,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
labelPadding: const EdgeInsets.all(0),
|
||||
indicatorPadding: const EdgeInsets.all(0),
|
||||
tabs: [
|
||||
Tab(
|
||||
text: AppTranslations.of(context)?.text("box.fcs_shipment_num"),
|
||||
),
|
||||
Tab(
|
||||
text: AppTranslations.of(context)?.text("box.consignee.title"),
|
||||
),
|
||||
Tab(
|
||||
text: AppTranslations.of(context)?.text("box.sender.title"),
|
||||
),
|
||||
Tab(
|
||||
text: AppTranslations.of(context)?.text("box.status"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import '../widgets/box_size_picker.dart';
|
||||
import '../widgets/continue_button.dart';
|
||||
import '../widgets/display_text.dart';
|
||||
import '../widgets/local_dropdown.dart';
|
||||
import '../widgets/local_radio_buttons.dart';
|
||||
import '../widgets/local_text.dart';
|
||||
import '../widgets/local_title.dart';
|
||||
import '../widgets/previous_button.dart';
|
||||
@@ -62,7 +61,7 @@ class CartonSizeWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _CartonSizeWidgetState extends State<CartonSizeWidget> {
|
||||
List<String> _deliveryTypes = [delivery_caton, pickup_carton];
|
||||
// List<String> _deliveryTypes = [delivery_caton, pickup_carton];
|
||||
|
||||
FcsShipment? _shipment;
|
||||
String _cartonSizeType = standardCarton;
|
||||
@@ -132,7 +131,7 @@ class _CartonSizeWidgetState extends State<CartonSizeWidget> {
|
||||
text: widget.sender.name,
|
||||
labelTextKey: "box.sender.title",
|
||||
iconData: MaterialCommunityIcons.account_arrow_right,
|
||||
subText: Text(widget.sender.fcsID!,
|
||||
subText: Text(widget.sender.fcsID ?? "",
|
||||
style: TextStyle(fontSize: 13, color: labelColor)),
|
||||
);
|
||||
|
||||
@@ -145,6 +144,7 @@ class _CartonSizeWidgetState extends State<CartonSizeWidget> {
|
||||
);
|
||||
|
||||
final userRow = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: senderBox,
|
||||
@@ -154,14 +154,71 @@ class _CartonSizeWidgetState extends State<CartonSizeWidget> {
|
||||
],
|
||||
);
|
||||
|
||||
final deliveryTypeBox = LocalRadioButtons(
|
||||
values: _deliveryTypes,
|
||||
selectedValue: _selectedDeliveryType,
|
||||
callback: (String? v) {
|
||||
setState(() {
|
||||
_selectedDeliveryType = v!;
|
||||
});
|
||||
});
|
||||
final deliveryTypeBox = Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_selectedDeliveryType = delivery_caton;
|
||||
});
|
||||
},
|
||||
child: Row(children: <Widget>[
|
||||
LocalRadio(
|
||||
value: delivery_caton,
|
||||
groupValue: _selectedDeliveryType,
|
||||
onChanged: (p0) {
|
||||
setState(() {
|
||||
_selectedDeliveryType = delivery_caton;
|
||||
});
|
||||
},
|
||||
),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: LocalText(context, 'box.delivery',
|
||||
fontSize: 15,
|
||||
color: _selectedDeliveryType == delivery_caton
|
||||
? primaryColor
|
||||
: Colors.black),
|
||||
),
|
||||
)
|
||||
]),
|
||||
)),
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_selectedDeliveryType = pickup_carton;
|
||||
});
|
||||
},
|
||||
child: Row(children: <Widget>[
|
||||
LocalRadio(
|
||||
value: pickup_carton,
|
||||
groupValue: _selectedDeliveryType,
|
||||
onChanged: (p0) {
|
||||
setState(() {
|
||||
_selectedDeliveryType = pickup_carton;
|
||||
});
|
||||
},
|
||||
),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: LocalText(context, 'box.pickup',
|
||||
fontSize: 15,
|
||||
color: _selectedDeliveryType == pickup_carton
|
||||
? primaryColor
|
||||
: Colors.black),
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
final billRadioBox = Container(
|
||||
child: Row(
|
||||
@@ -186,7 +243,7 @@ class _CartonSizeWidgetState extends State<CartonSizeWidget> {
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: LocalText(context, 'box.bill_to_sender',
|
||||
child: LocalText(context, 'box.sender.title',
|
||||
fontSize: 15,
|
||||
color: _billToValue == billToSender
|
||||
? primaryColor
|
||||
@@ -215,7 +272,7 @@ class _CartonSizeWidgetState extends State<CartonSizeWidget> {
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: LocalText(context, 'box.bill_to.consignee',
|
||||
child: LocalText(context, 'box.consignee.title',
|
||||
fontSize: 15,
|
||||
color: _billToValue == billToConsignee
|
||||
? primaryColor
|
||||
@@ -465,12 +522,14 @@ class _CartonSizeWidgetState extends State<CartonSizeWidget> {
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
userRow,
|
||||
LocalTitle(textKey: "box.bill_to", topPadding: 8),
|
||||
const SizedBox(height: 5),
|
||||
billRadioBox,
|
||||
const SizedBox(height: 8),
|
||||
LocalTitle(textKey: "box.select.delivery"),
|
||||
const SizedBox(height: 5),
|
||||
deliveryTypeBox,
|
||||
const SizedBox(height: 5),
|
||||
const SizedBox(height: 8),
|
||||
LocalTitle(textKey: "box.select_carton_size"),
|
||||
const SizedBox(height: 8),
|
||||
cartonSizedBox,
|
||||
|
||||
@@ -71,7 +71,8 @@ class CartonSubmit extends StatelessWidget {
|
||||
child: SubmitTextWidget(
|
||||
labelKey: 'box.carton.type',
|
||||
text: carton_from_packages,
|
||||
subText: boxDimension),
|
||||
// subText: boxDimension
|
||||
),
|
||||
);
|
||||
|
||||
final shipmentBox = Padding(
|
||||
@@ -135,9 +136,9 @@ class CartonSubmit extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
billToValue == billToSender
|
||||
? billWidget(context)
|
||||
: const SizedBox()
|
||||
// billToValue == billToSender
|
||||
// ? billWidget(context)
|
||||
// : const SizedBox()
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -162,9 +163,9 @@ class CartonSubmit extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
billToValue == billToConsignee
|
||||
? billWidget(context)
|
||||
: const SizedBox()
|
||||
// billToValue == billToConsignee
|
||||
// ? billWidget(context)
|
||||
// : const SizedBox()
|
||||
],
|
||||
),
|
||||
))
|
||||
@@ -174,14 +175,30 @@ class CartonSubmit extends StatelessWidget {
|
||||
]),
|
||||
);
|
||||
|
||||
final billToBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: SubmitTextWidget(
|
||||
labelKey: 'box.bill_to',
|
||||
text: billToValue == billToSender ? 'Sender' : 'Consignee',
|
||||
),
|
||||
);
|
||||
|
||||
final deliveryTypeBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: SubmitTextWidget(
|
||||
labelKey: 'box.delivery_type',
|
||||
labelKey: 'box.select.delivery',
|
||||
text: deliveryType,
|
||||
),
|
||||
);
|
||||
|
||||
final cartonSizeBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: SubmitTextWidget(
|
||||
labelKey: 'box.carton_size',
|
||||
text: boxDimension??'',
|
||||
),
|
||||
);
|
||||
|
||||
final packagesBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
|
||||
@@ -341,12 +358,16 @@ class CartonSubmit extends StatelessWidget {
|
||||
children: [
|
||||
cartonType,
|
||||
const SizedBox(height: 10),
|
||||
shipmentBox,
|
||||
const SizedBox(height: 10),
|
||||
usersBox,
|
||||
const SizedBox(height: 10),
|
||||
billToBox,
|
||||
const SizedBox(height: 10),
|
||||
deliveryTypeBox,
|
||||
const SizedBox(height: 10),
|
||||
cartonSizeBox,
|
||||
const SizedBox(height: 10),
|
||||
shipmentBox,
|
||||
const SizedBox(height: 10),
|
||||
packages.isNotEmpty ? packagesBox : const SizedBox(),
|
||||
const SizedBox(height: 10),
|
||||
cargosBox,
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/local_title.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -117,9 +116,6 @@ class _CustomDutyAdditionState extends State<CustomDutyAddition> {
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
LocalTitle(
|
||||
textKey: "box.select.cargo.title",
|
||||
),
|
||||
Column(
|
||||
children: getCargoRowList(customDuties),
|
||||
),
|
||||
|
||||
@@ -112,7 +112,15 @@ class _MixCartonSubmitState extends State<MixCartonSubmit> {
|
||||
child: SubmitTextWidget(
|
||||
labelKey: 'box.carton.type',
|
||||
text: carton_mix_carton,
|
||||
subText: boxDimension,
|
||||
// subText: boxDimension,
|
||||
),
|
||||
);
|
||||
|
||||
final cartonSizeBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: SubmitTextWidget(
|
||||
labelKey: 'box.carton_size',
|
||||
text: boxDimension ?? '',
|
||||
),
|
||||
);
|
||||
|
||||
@@ -284,6 +292,8 @@ class _MixCartonSubmitState extends State<MixCartonSubmit> {
|
||||
children: [
|
||||
cartonType,
|
||||
const SizedBox(height: 10),
|
||||
cartonSizeBox,
|
||||
const SizedBox(height: 10),
|
||||
shipmentBox,
|
||||
const SizedBox(height: 10),
|
||||
widget.cartons.isNotEmpty ? cartonsBox : const SizedBox(),
|
||||
|
||||
@@ -126,6 +126,7 @@ class _PackageSelectionWidgetState extends State<PackageSelectionWidget> {
|
||||
);
|
||||
|
||||
final userRow = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: senderBox,
|
||||
|
||||
Reference in New Issue
Block a user