prepare carton info
This commit is contained in:
@@ -36,6 +36,8 @@ class Carton {
|
|||||||
String? mixCartonNumber;
|
String? mixCartonNumber;
|
||||||
String? cartonSizeID;
|
String? cartonSizeID;
|
||||||
String? cartonSizeName;
|
String? cartonSizeName;
|
||||||
|
String? cartonSizeType;
|
||||||
|
String? cartonStandardSize;
|
||||||
double cartonWeight;
|
double cartonWeight;
|
||||||
String? billTo;
|
String? billTo;
|
||||||
bool isSelected;
|
bool isSelected;
|
||||||
@@ -49,6 +51,7 @@ class Carton {
|
|||||||
String? remark;
|
String? remark;
|
||||||
DateTime? arrivedDate;
|
DateTime? arrivedDate;
|
||||||
String? cartonNumber;
|
String? cartonNumber;
|
||||||
|
String? deliveryCarton;
|
||||||
|
|
||||||
List<String> packageIDs;
|
List<String> packageIDs;
|
||||||
List<Package> packages;
|
List<Package> packages;
|
||||||
@@ -159,6 +162,9 @@ class Carton {
|
|||||||
this.deliveryAddress,
|
this.deliveryAddress,
|
||||||
this.cartonSizeID,
|
this.cartonSizeID,
|
||||||
this.cartonSizeName,
|
this.cartonSizeName,
|
||||||
|
this.cartonSizeType,
|
||||||
|
this.cartonStandardSize,
|
||||||
|
this.deliveryCarton,
|
||||||
this.mixBoxType,
|
this.mixBoxType,
|
||||||
this.mixCartons = const [],
|
this.mixCartons = const [],
|
||||||
this.mixCartonIDs = const [],
|
this.mixCartonIDs = const [],
|
||||||
|
|||||||
@@ -39,20 +39,11 @@ class _CartonImageUploaState extends State<CartonImageUploadEditor> {
|
|||||||
labelColor: primaryColor,
|
labelColor: primaryColor,
|
||||||
arrowColor: primaryColor,
|
arrowColor: primaryColor,
|
||||||
actions: []
|
actions: []
|
||||||
// isEdiable
|
|
||||||
// ? <Widget>[
|
|
||||||
// IconButton(
|
|
||||||
// icon: Icon(Icons.edit, color: primaryColor),
|
|
||||||
// onPressed: _gotoEditor,
|
|
||||||
// ),
|
|
||||||
// IconButton(
|
|
||||||
// icon: Icon(Icons.delete, color: primaryColor),
|
|
||||||
// onPressed: _delete,
|
|
||||||
// ),
|
|
||||||
// ]
|
|
||||||
// : [],
|
|
||||||
),
|
),
|
||||||
body: ListView(
|
body:
|
||||||
|
Padding(padding:EdgeInsets.only(left: 12.0, right: 12),
|
||||||
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
Center(
|
Center(
|
||||||
child: Text("${_box?.cartonNumber}",
|
child: Text("${_box?.cartonNumber}",
|
||||||
@@ -60,6 +51,7 @@ class _CartonImageUploaState extends State<CartonImageUploadEditor> {
|
|||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
))),
|
))),
|
||||||
|
|
||||||
MultiImageFile(
|
MultiImageFile(
|
||||||
enabled: true,
|
enabled: true,
|
||||||
controller: multiImgController,
|
controller: multiImgController,
|
||||||
@@ -80,6 +72,7 @@ class _CartonImageUploaState extends State<CartonImageUploadEditor> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
||||||
final NumberFormat numberFormatter = NumberFormat("#,###");
|
final NumberFormat numberFormatter = NumberFormat("#,###");
|
||||||
MultiImgController multiImgController = MultiImgController();
|
MultiImgController multiImgController = MultiImgController();
|
||||||
|
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
late Carton _carton;
|
late Carton _carton;
|
||||||
|
|
||||||
List<CargoType> _cargoTypes = [];
|
List<CargoType> _cargoTypes = [];
|
||||||
List<CargoType> _surchareItems = [];
|
List<CargoType> _surchareItems = [];
|
||||||
List<Carton> _mixCartons = [];
|
List<Carton> _mixCartons = [];
|
||||||
List<Package> _packages = [];
|
List<Package> _packages = [];
|
||||||
|
double totalWeight=0.0;
|
||||||
|
double totalSurchargeCount=0.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -52,6 +52,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
|
|
||||||
_init() async {
|
_init() async {
|
||||||
_carton.billTo = billToSender;
|
_carton.billTo = billToSender;
|
||||||
|
_carton.cartonSizeType=standardCarton;
|
||||||
_carton.cartonType = carton_from_packages;
|
_carton.cartonType = carton_from_packages;
|
||||||
multiImgController.setImageUrls = _carton.photos;
|
multiImgController.setImageUrls = _carton.photos;
|
||||||
_cargoTypes = _carton.cargoTypes.where((e) => !e.isCutomDuty).toList();
|
_cargoTypes = _carton.cargoTypes.where((e) => !e.isCutomDuty).toList();
|
||||||
@@ -71,14 +72,16 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
_carton.cartonType="Carton for packages";
|
||||||
|
totalWeight =
|
||||||
|
_carton.cargoTypes.fold(0, (sum, value) => sum + value.weight);
|
||||||
|
totalSurchargeCount =
|
||||||
|
_surchareItems.fold(0, (sum, value) => sum + value.qty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
double totalWeight =
|
|
||||||
_carton.cargoTypes.fold(0, (sum, value) => sum + value.weight);
|
|
||||||
double totalSurchargeCount =
|
|
||||||
_surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|
||||||
|
|
||||||
final cartonTypeBox = DisplayText(
|
final cartonTypeBox = DisplayText(
|
||||||
text: _carton.cartonNumber,
|
text: _carton.cartonNumber,
|
||||||
@@ -86,6 +89,11 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final cartonQrBox = DisplayText(iconData: AntDesign.qrcode);
|
final cartonQrBox = DisplayText(iconData: AntDesign.qrcode);
|
||||||
|
final cartonSubTypeBox = DisplayText(
|
||||||
|
text: _carton.cartonType==carton_from_packages ? "Carton for packages":"Mix carton",
|
||||||
|
subText:Text( "${_carton.cartonStandardSize}"),
|
||||||
|
labelTextKey: "box.carton.type",
|
||||||
|
);
|
||||||
|
|
||||||
final shipmentBox = DisplayText(
|
final shipmentBox = DisplayText(
|
||||||
text: _carton.fcsShipmentNumber,
|
text: _carton.fcsShipmentNumber,
|
||||||
@@ -93,19 +101,19 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final deliveryBox = DisplayText(
|
final deliveryBox = DisplayText(
|
||||||
text: "Delivery Carton",
|
text: _carton.deliveryCarton,
|
||||||
labelTextKey: "box.delivery_type",
|
labelTextKey: "box.delivery_type",
|
||||||
);
|
);
|
||||||
|
|
||||||
final senderBox = DisplayText(
|
final senderBox = DisplayText(
|
||||||
text: _carton.userName == null ? "" : _carton.userName,
|
text: _carton.senderName== null ? "" : _carton.senderName,
|
||||||
subText: Text(_carton.fcsID ?? "", style: textStyle),
|
subText: Text(_carton.senderFCSID?? "", style: textStyle),
|
||||||
labelTextKey: "box.name",
|
labelTextKey: "box.name",
|
||||||
);
|
);
|
||||||
|
|
||||||
final consigneeNameBox = DisplayText(
|
final consigneeNameBox = DisplayText(
|
||||||
text: _carton.senderName != null ? _carton.senderName : "",
|
text: _carton.userName != null ? _carton.userName : "",
|
||||||
subText: Text(_carton.senderFCSID ?? "", style: textStyle),
|
subText: Text(_carton.fcsID?? "", style: textStyle),
|
||||||
labelTextKey: "processing.consignee.name",
|
labelTextKey: "processing.consignee.name",
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -338,14 +346,20 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
child: cartonQrBox,
|
child: cartonQrBox,
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
|
Row(children: [Flexible(child: cartonSubTypeBox),],),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Flexible(child: shipmentBox),
|
Flexible(child: shipmentBox),
|
||||||
Flexible(child: deliveryBox),
|
_mixCartons.isEmpty
|
||||||
|
?
|
||||||
|
Flexible(child: deliveryBox):const SizedBox(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
userRowBox,
|
_mixCartons.isEmpty
|
||||||
|
?
|
||||||
|
userRowBox:
|
||||||
|
const SizedBox(),
|
||||||
_packages.isEmpty
|
_packages.isEmpty
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: Padding(
|
: Padding(
|
||||||
|
|||||||
Reference in New Issue
Block a user