Merge branch 'master' of tzw/fcs into master
This commit is contained in:
@@ -37,6 +37,7 @@ class Carton {
|
|||||||
String? cartonSizeID;
|
String? cartonSizeID;
|
||||||
String? cartonSizeName;
|
String? cartonSizeName;
|
||||||
double cartonWeight;
|
double cartonWeight;
|
||||||
|
String? billToValue;
|
||||||
bool isSelected;
|
bool isSelected;
|
||||||
|
|
||||||
int rate;
|
int rate;
|
||||||
@@ -44,6 +45,7 @@ class Carton {
|
|||||||
String? packageType;
|
String? packageType;
|
||||||
String? pickUpID;
|
String? pickUpID;
|
||||||
List<String> photos = [];
|
List<String> photos = [];
|
||||||
|
List<String> photoUrls;
|
||||||
String? remark;
|
String? remark;
|
||||||
DateTime? arrivedDate;
|
DateTime? arrivedDate;
|
||||||
String? cartonNumber;
|
String? cartonNumber;
|
||||||
@@ -147,6 +149,7 @@ class Carton {
|
|||||||
this.packages = const [],
|
this.packages = const [],
|
||||||
this.cargoTypes = const [],
|
this.cargoTypes = const [],
|
||||||
this.cartonNumber,
|
this.cartonNumber,
|
||||||
|
this.billToValue,
|
||||||
this.fcsShipmentID,
|
this.fcsShipmentID,
|
||||||
this.fcsShipmentNumber,
|
this.fcsShipmentNumber,
|
||||||
this.packageIDs = const [],
|
this.packageIDs = const [],
|
||||||
@@ -160,6 +163,7 @@ class Carton {
|
|||||||
this.mixCartons = const [],
|
this.mixCartons = const [],
|
||||||
this.mixCartonIDs = const [],
|
this.mixCartonIDs = const [],
|
||||||
this.cartonWeight =0,
|
this.cartonWeight =0,
|
||||||
|
this.photoUrls = const [],
|
||||||
this.isSelected = false});
|
this.isSelected = false});
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
@@ -199,6 +203,8 @@ class Carton {
|
|||||||
List<Map<String, dynamic>>.from(map['mix_cartons'] ?? []);
|
List<Map<String, dynamic>>.from(map['mix_cartons'] ?? []);
|
||||||
var _mixCartons =
|
var _mixCartons =
|
||||||
mixCartonsMaps.map((e) => Carton.fromMap(e, e["id"])).toList();
|
mixCartonsMaps.map((e) => Carton.fromMap(e, e["id"])).toList();
|
||||||
|
List<String> _photoUrls =
|
||||||
|
map['photo_urls'] == null ? [] : List.from(map['photo_urls']);
|
||||||
|
|
||||||
return Carton(
|
return Carton(
|
||||||
id: docID,
|
id: docID,
|
||||||
@@ -231,6 +237,7 @@ class Carton {
|
|||||||
senderName: map['sender_name'],
|
senderName: map['sender_name'],
|
||||||
mixCartonIDs: List<String>.from(map['mix_carton_ids'] ?? []),
|
mixCartonIDs: List<String>.from(map['mix_carton_ids'] ?? []),
|
||||||
cartonWeight: (map['carton_weight'] ?? 0).toDouble(),
|
cartonWeight: (map['carton_weight'] ?? 0).toDouble(),
|
||||||
|
photoUrls: _photoUrls,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +261,8 @@ class Carton {
|
|||||||
'mix_cartons': _mixCartons,
|
'mix_cartons': _mixCartons,
|
||||||
'sender_id': senderID,
|
'sender_id': senderID,
|
||||||
'sender_fcs_id': senderFCSID,
|
'sender_fcs_id': senderFCSID,
|
||||||
'sender_name': senderName
|
'sender_name': senderName,
|
||||||
|
"photo_urls": photoUrls
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||||
import '../main/util.dart';
|
import '../main/util.dart';
|
||||||
import 'carton_editor_for_package.dart';
|
import 'carton_editor_for_package.dart';
|
||||||
|
import 'carton_info.dart';
|
||||||
import 'mix_carton/mix_carton_editor.dart';
|
import 'mix_carton/mix_carton_editor.dart';
|
||||||
import 'carton_row.dart';
|
import 'carton_row.dart';
|
||||||
|
|
||||||
@@ -63,10 +64,7 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
_carton = Carton(cargoTypes: [], packages: []);
|
_carton = Carton(cargoTypes: [], packages: []);
|
||||||
_isNew = true;
|
_isNew = true;
|
||||||
_selectedCartonType = carton_from_packages;
|
_selectedCartonType = carton_from_packages;
|
||||||
_cartons = [
|
_cartons = [];
|
||||||
Carton(cartonNumber: "A177(A)-3#2", cartonWeight: 35.5),
|
|
||||||
Carton(cartonNumber: "A177(A)-3#1", cartonWeight: 25.5)
|
|
||||||
];
|
|
||||||
_sender = User(
|
_sender = User(
|
||||||
name: "ptd-phyo44 kaelone",
|
name: "ptd-phyo44 kaelone",
|
||||||
fcsID: "FCS-8X6V",
|
fcsID: "FCS-8X6V",
|
||||||
@@ -159,7 +157,9 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
context,
|
context,
|
||||||
CupertinoPageRoute(
|
CupertinoPageRoute(
|
||||||
builder: (context) => CartonEditorForPackage(
|
builder: (context) => CartonEditorForPackage(
|
||||||
sender: _sender!, consignee: _consignee!,billToValue: _billToValue)));
|
sender: _sender!,
|
||||||
|
consignee: _consignee!,
|
||||||
|
billToValue: _billToValue)));
|
||||||
}
|
}
|
||||||
// for mix cartion
|
// for mix cartion
|
||||||
else {
|
else {
|
||||||
@@ -293,7 +293,9 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
padding: const EdgeInsets.only(left: 10),
|
padding: const EdgeInsets.only(left: 10),
|
||||||
child: LocalText(context, 'box.bill_to_sender',
|
child: LocalText(context, 'box.bill_to_sender',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: _billToValue == billToSender ? primaryColor : Colors.black),
|
color: _billToValue == billToSender
|
||||||
|
? primaryColor
|
||||||
|
: Colors.black),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
@@ -320,7 +322,9 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
padding: const EdgeInsets.only(left: 10),
|
padding: const EdgeInsets.only(left: 10),
|
||||||
child: LocalText(context, 'box.bill_to.consignee',
|
child: LocalText(context, 'box.bill_to.consignee',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: _billToValue == billToConsignee ? primaryColor : Colors.black),
|
color: _billToValue == billToConsignee
|
||||||
|
? primaryColor
|
||||||
|
: Colors.black),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
@@ -372,8 +376,15 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> _getCartons(BuildContext context, List<Carton> cartons) {
|
List<Widget> _getCartons(BuildContext context, List<Carton> cartons) {
|
||||||
return cartons.asMap().entries.map((c) {
|
return cartons.map((c) {
|
||||||
return InkWell(onTap: () async {}, child: CartonRow(box: c.value));
|
return InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
CupertinoPageRoute(builder: (context) => CartonInfo(box: c)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: CartonRow(box: c));
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import 'package:fcs/domain/entities/carton.dart';
|
import 'package:fcs/domain/entities/carton.dart';
|
||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
|
|
||||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||||
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
||||||
import 'package:fcs/pages/widgets/progress.dart';
|
import 'package:fcs/pages/widgets/progress.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../widgets/multi_img_file.dart';
|
||||||
|
|
||||||
typedef void FindCallBack();
|
typedef void FindCallBack();
|
||||||
|
|
||||||
class CartonImageUpload extends StatefulWidget {
|
class CartonImageUpload extends StatefulWidget {
|
||||||
@@ -18,13 +19,13 @@ class CartonImageUpload extends StatefulWidget {
|
|||||||
class _CartonImageUploaState extends State<CartonImageUpload> {
|
class _CartonImageUploaState extends State<CartonImageUpload> {
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
Carton? _box;
|
Carton? _box;
|
||||||
|
|
||||||
MultiImgController multiImgController = MultiImgController();
|
MultiImgController multiImgController = MultiImgController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
multiImgController.setImageUrls = _box!.photos;
|
_box = widget.box;
|
||||||
|
multiImgController.setImageUrls = _box?.photoUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -53,13 +54,32 @@ class _CartonImageUploaState extends State<CartonImageUpload> {
|
|||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: [
|
children: [
|
||||||
//img
|
Center(
|
||||||
|
child: Text("${_box?.cartonNumber}",
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor,
|
||||||
|
fontSize: 25,
|
||||||
|
))),
|
||||||
|
MultiImageFile(
|
||||||
|
enabled: true,
|
||||||
|
controller: multiImgController,
|
||||||
|
title: "Receipt File",
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Color(0xff272262),
|
||||||
|
elevation: 3,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(5.0)),
|
||||||
|
minimumSize: Size(300, 45), //////// HERE
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
child:
|
||||||
|
const Text('Save', style: TextStyle(fontSize: 20)),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
// final img = MultiImageFile(
|
|
||||||
// enabled: true,
|
|
||||||
// controller:multiImgController,
|
|
||||||
// title: "Receipt File",
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import 'package:fcs/domain/entities/carton.dart';
|
|||||||
import 'package:fcs/domain/entities/package.dart';
|
import 'package:fcs/domain/entities/package.dart';
|
||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
import 'package:fcs/pages/carton/carton_image_upload.dart';
|
import 'package:fcs/pages/carton/carton_image_upload.dart';
|
||||||
|
import 'package:fcs/pages/carton/carton_submit.dart';
|
||||||
import 'package:fcs/pages/carton_size/model/carton_size_model.dart';
|
import 'package:fcs/pages/carton_size/model/carton_size_model.dart';
|
||||||
import 'package:fcs/pages/main/util.dart';
|
import 'package:fcs/pages/main/util.dart';
|
||||||
import 'package:fcs/pages/package/model/package_model.dart';
|
import 'package:fcs/pages/package/model/package_model.dart';
|
||||||
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
||||||
import 'package:fcs/pages/widgets/display_text.dart';
|
import 'package:fcs/pages/widgets/display_text.dart';
|
||||||
import 'package:fcs/pages/widgets/length_picker.dart';
|
|
||||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||||
import 'package:fcs/pages/widgets/local_text.dart';
|
import 'package:fcs/pages/widgets/local_text.dart';
|
||||||
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
||||||
@@ -22,7 +22,6 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import 'carton_editor.dart';
|
import 'carton_editor.dart';
|
||||||
import 'carton_row.dart';
|
|
||||||
import 'model/carton_model.dart';
|
import 'model/carton_model.dart';
|
||||||
|
|
||||||
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
||||||
@@ -31,8 +30,11 @@ final NumberFormat numberFormatter = NumberFormat("#,###");
|
|||||||
class CartonInfo extends StatefulWidget {
|
class CartonInfo extends StatefulWidget {
|
||||||
final Package? package;
|
final Package? package;
|
||||||
final Carton box;
|
final Carton box;
|
||||||
|
final String? billToValue;
|
||||||
|
final CartonSubmit? cartonSubmit;
|
||||||
|
|
||||||
CartonInfo({required this.box,this.package});
|
CartonInfo(
|
||||||
|
{required this.box, this.billToValue, this.package, this.cartonSubmit});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_CartonInfoState createState() => _CartonInfoState();
|
_CartonInfoState createState() => _CartonInfoState();
|
||||||
@@ -42,9 +44,8 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
Carton? _box;
|
Carton? _box;
|
||||||
|
|
||||||
|
CartonSubmit? _cartonSubmit;
|
||||||
|
|
||||||
|
|
||||||
// DeliveryAddress? _deliveryAddress = new DeliveryAddress();
|
|
||||||
MultiImgController multiImgController = MultiImgController();
|
MultiImgController multiImgController = MultiImgController();
|
||||||
TextEditingController _widthController = new TextEditingController();
|
TextEditingController _widthController = new TextEditingController();
|
||||||
TextEditingController _heightController = new TextEditingController();
|
TextEditingController _heightController = new TextEditingController();
|
||||||
@@ -62,10 +63,14 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
bool isEdiable = false;
|
bool isEdiable = false;
|
||||||
final List<CargoType> cargoTypes = [];
|
final List<CargoType> cargoTypes = [];
|
||||||
final List<CargoType> surchareItems = [];
|
final List<CargoType> surchareItems = [];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_box = widget.box;
|
_box = widget.box;
|
||||||
|
_box?.billToValue = "Bill to sender";
|
||||||
|
_cartonSubmit = widget.cartonSubmit;
|
||||||
|
|
||||||
//initPackage(widget.package!);
|
//initPackage(widget.package!);
|
||||||
//for shipment weight
|
//for shipment weight
|
||||||
volumetricRatio = Provider.of<ShipmentRateModel>(context, listen: false)
|
volumetricRatio = Provider.of<ShipmentRateModel>(context, listen: false)
|
||||||
@@ -75,18 +80,16 @@ final List<CargoType> surchareItems=[];
|
|||||||
_widthController.addListener(_calShipmentWeight);
|
_widthController.addListener(_calShipmentWeight);
|
||||||
_heightController.addListener(_calShipmentWeight);
|
_heightController.addListener(_calShipmentWeight);
|
||||||
multiImgController.setImageUrls = _box!.photos;
|
multiImgController.setImageUrls = _box!.photos;
|
||||||
_updateBoxData();
|
// _updateBoxData();
|
||||||
_loadPackages();
|
_loadPackages();
|
||||||
_loadMixCartons();
|
_loadMixCartons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_updateBoxData() {
|
_updateBoxData() {
|
||||||
_widthController.text = _box!.width.toString();
|
_widthController.text = _box!.width.toString();
|
||||||
_heightController.text = _box!.height.toString();
|
_heightController.text = _box!.height.toString();
|
||||||
_lengthController.text = _box!.length.toString();
|
_lengthController.text = _box!.length.toString();
|
||||||
_cartonSizeController.text = _box!.cartonSizeName ?? "";
|
_cartonSizeController.text = _box!.cartonSizeName ?? "";
|
||||||
// _deliveryAddress = _box!.deliveryAddress;
|
|
||||||
isMixBox = _box!.cartonType == carton_mix_box;
|
isMixBox = _box!.cartonType == carton_mix_box;
|
||||||
isFromShipments = _box!.cartonType == carton_from_shipments;
|
isFromShipments = _box!.cartonType == carton_from_shipments;
|
||||||
isFromPackages = _box!.cartonType == carton_from_packages;
|
isFromPackages = _box!.cartonType == carton_from_packages;
|
||||||
@@ -115,8 +118,8 @@ final List<CargoType> surchareItems=[];
|
|||||||
_loadPackages() async {
|
_loadPackages() async {
|
||||||
if (!isFromPackages && !isSmallBag) return;
|
if (!isFromPackages && !isSmallBag) return;
|
||||||
|
|
||||||
if (_box!.cartonType == carton_from_packages && _box!.userID == null)
|
// if (_box!.cartonType == carton_from_packages && _box!.userID == null)
|
||||||
return;
|
// return;
|
||||||
PackageModel packageModel =
|
PackageModel packageModel =
|
||||||
Provider.of<PackageModel>(context, listen: false);
|
Provider.of<PackageModel>(context, listen: false);
|
||||||
List<Package> packages =
|
List<Package> packages =
|
||||||
@@ -168,142 +171,44 @@ final List<CargoType> surchareItems=[];
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
double totalWeight =
|
||||||
double totalWeight = _box!.cargoTypes.fold(0, (sum, value) => sum + value.weight);
|
_box!.cargoTypes.fold(0, (sum, value) => sum + value.weight);
|
||||||
double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
||||||
// final cartonTypeBox = LocalRadioButtons(
|
|
||||||
// readOnly: true,
|
|
||||||
// values: cartonModel.cartonTypesInfo,
|
|
||||||
// selectedValue: (_box!.isShipmentCarton ?? false)
|
|
||||||
// ? carton_from_shipments
|
|
||||||
// : _box!.cartonType);
|
|
||||||
final cartonTypeBox = DisplayText(
|
final cartonTypeBox = DisplayText(
|
||||||
text: _box!.cartonNumber,
|
text: _box!.cartonNumber,
|
||||||
labelTextKey: "box.number",
|
labelTextKey: "box.number",
|
||||||
//iconData: Ionicons.ios_airplane,
|
|
||||||
);
|
);
|
||||||
final cartonQrBox = DisplayText(
|
final cartonQrBox = DisplayText(
|
||||||
// text: _box!.,
|
|
||||||
//labelTextKey: "box.number",
|
|
||||||
iconData: AntDesign.qrcode,
|
iconData: AntDesign.qrcode,
|
||||||
);
|
);
|
||||||
final shipmentBox = DisplayText(
|
final shipmentBox = DisplayText(
|
||||||
text: _box!.fcsShipmentNumber,
|
text: _box!.fcsShipmentNumber,
|
||||||
labelTextKey: "box.fcs_shipment_num",
|
labelTextKey: "box.fcs_shipment_num",
|
||||||
// iconData: Ionicons.ios_airplane,
|
|
||||||
);
|
);
|
||||||
final deliveryBox = DisplayText(
|
final deliveryBox = DisplayText(
|
||||||
text: "Delivery Carton",
|
text: "Delivery Carton",
|
||||||
labelTextKey: "box.delivery_type",
|
labelTextKey: "box.delivery_type",
|
||||||
//icon: FcsIDIcon(),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// final fcsIDBox = DisplayText(
|
|
||||||
// text: _box!.fcsID == null ? "" : _box!.fcsID,
|
|
||||||
// labelTextKey: "box.fcs.id",
|
|
||||||
// //icon: FcsIDIcon(),
|
|
||||||
// );
|
|
||||||
|
|
||||||
final customerNameBox = DisplayText(
|
final customerNameBox = DisplayText(
|
||||||
text: _box!.userName == null ? "" : _box!.userName,
|
text: _box!.userName == null ? "" : _box!.userName,
|
||||||
subText: Text(_box!.fcsID ?? "", style: textStyle),
|
subText: Text(_box!.fcsID ?? "", style: textStyle),
|
||||||
labelTextKey: "box.name",
|
labelTextKey: "box.name",
|
||||||
|
|
||||||
//iconData: Icons.person,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// final consigneefcsIDBox = DisplayText(
|
|
||||||
// text: _box!.fcsID != null ? _box!.fcsID : "",
|
|
||||||
// labelTextKey: "processing.fcs.id",
|
|
||||||
// icon: FcsIDIcon(),
|
|
||||||
// );
|
|
||||||
|
|
||||||
final consigneeNameBox = DisplayText(
|
final consigneeNameBox = DisplayText(
|
||||||
text: _box!.senderName != null ? _box!.senderName : "",
|
text: _box!.senderName != null ? _box!.senderName : "",
|
||||||
subText: Text(_box!.senderFCSID ?? "", style: textStyle),
|
subText: Text(_box!.senderFCSID ?? "", style: textStyle),
|
||||||
|
|
||||||
labelTextKey: "processing.consignee.name",
|
labelTextKey: "processing.consignee.name",
|
||||||
//maxLines: 2,
|
|
||||||
// iconData: Ionicons.document_text_outline,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// final consigneeBox = Container(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// consigneeNameBox,
|
|
||||||
// IconButton(icon:Icon(Ionicons.document_text_outline),
|
|
||||||
// onPressed:() {},),
|
|
||||||
// Text("Bill to",style:TextStyle(color:Color.fromARGB(255, 57, 80, 233)))
|
|
||||||
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
|
|
||||||
// final shipperIDBox = Row(
|
|
||||||
// children: <Widget>[
|
|
||||||
// Expanded(
|
|
||||||
// child: DisplayText(
|
|
||||||
// text: _box!.senderFCSID,
|
|
||||||
// labelTextKey: "processing.fcs.id",
|
|
||||||
// icon: FcsIDIcon(),
|
|
||||||
// )),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
|
|
||||||
// final shipperNamebox = DisplayText(
|
|
||||||
// text: _box!.senderName,
|
|
||||||
// labelTextKey: "processing.shipper.name",
|
|
||||||
// maxLines: 2,
|
|
||||||
// iconData: Icons.person,
|
|
||||||
// );
|
|
||||||
|
|
||||||
// final shipperBox = Container(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// shipperIDBox,
|
|
||||||
// shipperNamebox,
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
|
|
||||||
final lengthBox = LengthPicker(
|
|
||||||
controller: _lengthController,
|
|
||||||
lableKey: "box.length",
|
|
||||||
isReadOnly: true,
|
|
||||||
);
|
|
||||||
final widthBox = LengthPicker(
|
|
||||||
controller: _widthController,
|
|
||||||
lableKey: "box.width",
|
|
||||||
isReadOnly: true,
|
|
||||||
);
|
|
||||||
final heightBox = LengthPicker(
|
|
||||||
controller: _heightController,
|
|
||||||
lableKey: "box.height",
|
|
||||||
isReadOnly: true,
|
|
||||||
);
|
|
||||||
|
|
||||||
final dimBox = Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
|
||||||
child: Icon(FontAwesome.arrow_circle_right, color: primaryColor),
|
|
||||||
),
|
|
||||||
SizedBox(child: lengthBox, width: 80),
|
|
||||||
SizedBox(child: widthBox, width: 80),
|
|
||||||
SizedBox(child: heightBox, width: 80),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
final packageBox = DisplayText(
|
final packageBox = DisplayText(
|
||||||
//text: "203FVH",
|
|
||||||
labelTextKey: "box.package",
|
labelTextKey: "box.package",
|
||||||
|
|
||||||
);
|
);
|
||||||
final cargosBox = Padding(
|
final cargosBox = Padding(
|
||||||
padding: const EdgeInsets.only(top: 10),
|
padding: const EdgeInsets.only(top: 10),
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.only(left: 5, bottom: 5, right: 20),
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@@ -311,18 +216,14 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.normal),
|
fontWeight: FontWeight.normal),
|
||||||
Padding(padding: EdgeInsets.only(right: 100),
|
Padding(
|
||||||
child:
|
padding: EdgeInsets.only(right: 100),
|
||||||
Text("${removeTrailingZeros(totalWeight)} lb",
|
child: Text("${removeTrailingZeros(totalWeight)} lb",
|
||||||
style: TextStyle(color: Colors.black54, fontSize: 15)))
|
style: TextStyle(color: Colors.black54, fontSize: 15)))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
//),
|
//),
|
||||||
Container(
|
Container(
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// border: Border.all(color: primaryColor),
|
|
||||||
// borderRadius: BorderRadius.circular(5),
|
|
||||||
// ),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(right: 100),
|
padding: const EdgeInsets.only(right: 100),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -348,7 +249,6 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
);
|
);
|
||||||
}).toList()),
|
}).toList()),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -358,8 +258,6 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
final surchargeItemBox = Padding(
|
final surchargeItemBox = Padding(
|
||||||
padding: const EdgeInsets.only(top: 10),
|
padding: const EdgeInsets.only(top: 10),
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.only(left: 5, bottom: 5, right: 20),
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@@ -367,18 +265,14 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.normal),
|
fontWeight: FontWeight.normal),
|
||||||
Padding(padding: EdgeInsets.only(right: 100),
|
Padding(
|
||||||
child:
|
padding: EdgeInsets.only(right: 100),
|
||||||
Text("${removeTrailingZeros(totalPieces)} pcs",
|
child: Text("${removeTrailingZeros(totalPieces)} pcs",
|
||||||
style: TextStyle(color: Colors.black54, fontSize: 15)))
|
style: TextStyle(color: Colors.black54, fontSize: 15)))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
//),
|
//),
|
||||||
Container(
|
Container(
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// border: Border.all(color: primaryColor),
|
|
||||||
// borderRadius: BorderRadius.circular(5),
|
|
||||||
// ),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(right: 100),
|
padding: const EdgeInsets.only(right: 100),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -396,7 +290,8 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
style:
|
style:
|
||||||
TextStyle(color: Colors.black, fontSize: 15),
|
TextStyle(color: Colors.black, fontSize: 15),
|
||||||
),
|
),
|
||||||
Text("${removeTrailingZeros((e.qty).toDouble())} pc",
|
Text(
|
||||||
|
"${removeTrailingZeros((e.qty).toDouble())} pc",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black, fontSize: 15))
|
color: Colors.black, fontSize: 15))
|
||||||
],
|
],
|
||||||
@@ -435,68 +330,94 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
controller: multiImgController,
|
controller: multiImgController,
|
||||||
title: "Receipt File",
|
title: "Receipt File",
|
||||||
);
|
);
|
||||||
final billWidget
|
final displayMixBox = Container(
|
||||||
= Expanded(child:Padding(
|
child: Row(
|
||||||
padding: EdgeInsets.only(left: 0,top: 15),
|
children: [
|
||||||
child:
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Icon(Ionicons.document_text_outline, color: primaryColor, size: 20),
|
Expanded(
|
||||||
Text("Bill to", style: TextStyle(color: primaryColor, fontSize: 15))
|
child: Row(
|
||||||
],
|
//crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
)));
|
children: [
|
||||||
|
Expanded(
|
||||||
final cargoBox = DisplayText(
|
|
||||||
//text: "203FVH",
|
|
||||||
labelTextKey: "box.cargo.type",
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
final cartonSizeBox = DisplayText(
|
|
||||||
text: _cartonSizeController.text,
|
|
||||||
labelTextKey: "box.carton_size",
|
|
||||||
iconData: AntDesign.CodeSandbox,
|
|
||||||
);
|
|
||||||
// final cargoTableBox = CargoTable(
|
|
||||||
// cargoTypes: _box!.cargoTypes,
|
|
||||||
// );
|
|
||||||
// final mixCartonNumberBox = DisplayText(
|
|
||||||
// text: _box!.mixCartonNumber,
|
|
||||||
// labelTextKey: "box.mix.carton",
|
|
||||||
// iconData: MaterialCommunityIcons.package,
|
|
||||||
// );
|
|
||||||
|
|
||||||
final mixTypeBox = Container(
|
|
||||||
padding: EdgeInsets.only(top: 20),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
customerNameBox,
|
||||||
padding: EdgeInsets.only(left: 5),
|
|
||||||
child: LocalText(
|
|
||||||
context,
|
|
||||||
"box.mix_type",
|
|
||||||
color: primaryColor,
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
)),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Icon(
|
|
||||||
Icons.check,
|
|
||||||
color: primaryColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(selectMixBoxType ?? "")
|
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
_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(
|
||||||
|
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
|
||||||
|
? 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()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
packageBox,
|
||||||
|
Row(
|
||||||
|
children: getPackageList(_box!.packages),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
));
|
||||||
);
|
final billWidget = 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))
|
||||||
|
],
|
||||||
|
)));
|
||||||
|
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
@@ -519,83 +440,80 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
]
|
]
|
||||||
: [],
|
: [],
|
||||||
),
|
),
|
||||||
body:
|
body: Container(
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child:
|
child: ListView(children: <Widget>[
|
||||||
Column(children: [
|
|
||||||
|
|
||||||
Row(children: [
|
Row(children: [
|
||||||
Flexible(child:
|
Flexible(child: cartonTypeBox),
|
||||||
cartonTypeBox),
|
Flexible(
|
||||||
Flexible(child:
|
child: cartonQrBox,
|
||||||
cartonQrBox,
|
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Flexible(child: shipmentBox,),
|
Flexible(
|
||||||
Flexible(child: deliveryBox,),
|
child: shipmentBox,
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: deliveryBox,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
// Row(
|
||||||
],),
|
// mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
Row(
|
// Expanded(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
// child: Row(
|
||||||
children: [
|
// //crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Expanded(
|
// children: [
|
||||||
child: Row(
|
// Expanded(
|
||||||
|
// child: Column(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
// children: [
|
||||||
Expanded(
|
// customerNameBox,
|
||||||
child: Column(
|
// ],
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// ),
|
||||||
children: [
|
// ),
|
||||||
customerNameBox,
|
// _box?.billToValue == billToSender
|
||||||
],
|
// ? billWidget
|
||||||
),
|
// : const SizedBox()
|
||||||
),
|
// ],
|
||||||
CargoType().isCutomDuty == false
|
// ),
|
||||||
? billWidget
|
// ),
|
||||||
: const SizedBox()
|
// Expanded(
|
||||||
],
|
// child: Padding(
|
||||||
),
|
// padding: const EdgeInsets.only(left: 0),
|
||||||
),
|
// child: Row(
|
||||||
Expanded(
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Padding(
|
// children: [
|
||||||
padding: const EdgeInsets.only(left: 0),
|
// Expanded(
|
||||||
child: Row(
|
// child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
// children: [
|
||||||
Expanded(
|
// consigneeNameBox,
|
||||||
child: Column(
|
// ],
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// ),
|
||||||
children: [
|
// ),
|
||||||
consigneeNameBox,
|
// _cartonSubmit?.billToValue == billToSender
|
||||||
],
|
// ? billWidget
|
||||||
),
|
// : const SizedBox()
|
||||||
),
|
// ],
|
||||||
CargoType().isCutomDuty == true
|
// ),
|
||||||
? billWidget
|
// ))
|
||||||
: const SizedBox()
|
// ],
|
||||||
],
|
// ),
|
||||||
),
|
// packageBox,
|
||||||
))
|
// Row(
|
||||||
|
// children: getPackageList(_box!.packages),
|
||||||
|
// ),
|
||||||
|
// ]):Container(),
|
||||||
|
|
||||||
],),
|
|
||||||
|
|
||||||
packageBox,
|
|
||||||
Column(children:
|
|
||||||
getPackageList(_box!.packages),
|
|
||||||
),
|
|
||||||
cargosBox,
|
cargosBox,
|
||||||
surchargeItemBox,
|
surchargeItemBox,
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 200.0, right: 8.0),
|
||||||
Flexible(child:
|
|
||||||
Padding(padding: EdgeInsets.only(left: 200.0,right: 8.0),
|
|
||||||
|
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Color(0xff272262),
|
backgroundColor: Color(0xff272262),
|
||||||
@@ -607,13 +525,17 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
CupertinoPageRoute(builder: (context) => CartonImageUpload()),
|
CupertinoPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
CartonImageUpload(box: _box)),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: const Text('Upload Images'),
|
child: const Text('Upload Images'),
|
||||||
),)),
|
),
|
||||||
|
),
|
||||||
img,
|
img,
|
||||||
Center(child: ElevatedButton(
|
Center(
|
||||||
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Color(0xffff0606),
|
backgroundColor: Color(0xffff0606),
|
||||||
elevation: 3,
|
elevation: 3,
|
||||||
@@ -622,96 +544,11 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
minimumSize: Size(300, 45), //////// HERE
|
minimumSize: Size(300, 45), //////// HERE
|
||||||
),
|
),
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
child: const Text('Delete Carton',style:TextStyle(fontSize: 20)),
|
child: const Text('Delete Carton',
|
||||||
),),
|
style: TextStyle(fontSize: 20)),
|
||||||
|
),
|
||||||
//_package!.photoUrls.length == 0 || _package!.photoUrls.isEmpty ? Container() : img,
|
),
|
||||||
|
]))));
|
||||||
|
|
||||||
|
|
||||||
//LocalTitle(textKey: "box.shipment_info"),
|
|
||||||
// shipmentBox,
|
|
||||||
// isSmallBag ? mixCartonNumberBox : Container(),
|
|
||||||
// isMixBox
|
|
||||||
// ? Container()
|
|
||||||
// : isFromPackages
|
|
||||||
// ? fcsIDBox
|
|
||||||
// : Container(),
|
|
||||||
// isMixBox
|
|
||||||
// ? Container()
|
|
||||||
// : isFromPackages
|
|
||||||
// ? customerNameBox
|
|
||||||
// : Container(),
|
|
||||||
// isFromCartons
|
|
||||||
// ? Row(
|
|
||||||
// children: [
|
|
||||||
// Flexible(child: consigneeBox),
|
|
||||||
// Flexible(child: shipperBox)
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
// : Container(),
|
|
||||||
// Padding(padding: EdgeInsets.only(left: 10),
|
|
||||||
// child: Row(children:[
|
|
||||||
|
|
||||||
// ListView.builder(
|
|
||||||
// itemCount: pickups.length,
|
|
||||||
// itemBuilder: (context, index) {
|
|
||||||
// return ListTile(
|
|
||||||
// title: Text(pickups[index]),
|
|
||||||
// );
|
|
||||||
// },)
|
|
||||||
|
|
||||||
// ])),
|
|
||||||
// // isMixBox ? mixTypeBox : Container(),
|
|
||||||
// isMixBox ? LocalTitle(textKey: "box.mix_caton_title") : Container(),
|
|
||||||
// isMixBox
|
|
||||||
// ? Column(children: _getCartons(context, _box!.mixCartons))
|
|
||||||
// : Container(),
|
|
||||||
// isFromPackages || isSmallBag
|
|
||||||
// ? CartonPackageTable(
|
|
||||||
// packages: _box!.packages,
|
|
||||||
// )
|
|
||||||
// : Container(),
|
|
||||||
// isMixBox ? Container() : LocalTitle(textKey: "box.cargo.type"),
|
|
||||||
// isMixBox ? Container() : cargoTableBox,
|
|
||||||
// ...(isFromPackages || isFromCartons
|
|
||||||
// ? [
|
|
||||||
// LocalTitle(textKey: "box.dimension"),
|
|
||||||
// cartonSizeBox,
|
|
||||||
// dimBox,
|
|
||||||
// ]
|
|
||||||
// : []),
|
|
||||||
// isMixBox
|
|
||||||
// ? Container()
|
|
||||||
// : LocalTitle(textKey: "box.delivery_address"),
|
|
||||||
// isMixBox
|
|
||||||
// ? Container()
|
|
||||||
// : DefaultDeliveryAddress(
|
|
||||||
// deliveryAddress: _deliveryAddress,
|
|
||||||
// labelKey: "box.delivery_address",
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 20,
|
|
||||||
// )
|
|
||||||
])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
// ])
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Widget> _getCartons(BuildContext context, List<Carton> cartons) {
|
|
||||||
return cartons.map((c) {
|
|
||||||
return CartonRow(box: c);
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
List<Widget> _getPackages(BuildContext context, List<Package> packages) {
|
|
||||||
return packages.map((p) {
|
|
||||||
return Text(p.packageType!);
|
|
||||||
}).toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_gotoEditor() async {
|
_gotoEditor() async {
|
||||||
@@ -722,7 +559,7 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
);
|
);
|
||||||
if (updated ?? false) {
|
if (updated ?? false) {
|
||||||
var cartonModel = Provider.of<CartonModel>(context, listen: false);
|
var cartonModel = Provider.of<CartonModel>(context, listen: false);
|
||||||
var c = await cartonModel.getCarton(widget.box!.id ?? "");
|
var c = await cartonModel.getCarton(widget.box.id ?? "");
|
||||||
setState(() {
|
setState(() {
|
||||||
_box = c;
|
_box = c;
|
||||||
_loadPackages();
|
_loadPackages();
|
||||||
@@ -744,7 +581,7 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
var cartonModel = Provider.of<CartonModel>(context, listen: false);
|
var cartonModel = Provider.of<CartonModel>(context, listen: false);
|
||||||
await cartonModel.deleteCarton(widget.box!);
|
await cartonModel.deleteCarton(widget.box);
|
||||||
Navigator.pop(context, true);
|
Navigator.pop(context, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showMsgDialog(context, "Error", e.toString());
|
showMsgDialog(context, "Error", e.toString());
|
||||||
@@ -762,11 +599,11 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
child: Container(
|
child: Container(
|
||||||
//padding:
|
//padding:
|
||||||
//EdgeInsets.only(top: 0.0),
|
//EdgeInsets.only(top: 0.0),
|
||||||
child: Row(children:<Widget> [
|
child: Row(children: <Widget>[new Text(p.trackingID ?? '')]),
|
||||||
new Text(p.packageType ?? '')
|
));
|
||||||
]),
|
}).toList();
|
||||||
));}).toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> getCargoList(List<CargoType> _c) {
|
List<Widget> getCargoList(List<CargoType> _c) {
|
||||||
return _c.map((c) {
|
return _c.map((c) {
|
||||||
return Container(
|
return Container(
|
||||||
@@ -774,10 +611,8 @@ double totalPieces = surchareItems.fold(0, (sum, value) => sum + value.qty);
|
|||||||
child: Container(
|
child: Container(
|
||||||
//padding:
|
//padding:
|
||||||
//EdgeInsets.only(top: 0.0),
|
//EdgeInsets.only(top: 0.0),
|
||||||
child: Row(children:<Widget> [
|
child: Row(children: <Widget>[new Text(c.name ?? '')]),
|
||||||
new Text(c.name ?? '')
|
));
|
||||||
]),
|
}).toList();
|
||||||
));}).toList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user