update carton

This commit is contained in:
Thinzar Win
2021-01-12 16:59:52 +06:30
parent 9dee2c55f3
commit fddcc91515
11 changed files with 91 additions and 139 deletions

View File

@@ -67,7 +67,7 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
_widthCtl.text = "0";
_heightCtl.text = "0";
} else {
_cargoTypes = List.from(widget.carton.cargoTypes);
_cargoTypes = widget.carton.cargoTypes.map((e) => e.clone()).toList();
_lengthCtl.text = _carton.length.toString();
_widthCtl.text = _carton.width.toString();
_heightCtl.text = _carton.height.toString();
@@ -158,12 +158,11 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop(),
),
icon: new Icon(
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop()),
shadowColor: Colors.transparent,
backgroundColor: Colors.white,
title: LocalText(
@@ -192,13 +191,8 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
CupertinoPageRoute(
builder: (context) => DeliveryAddressSelection(
deliveryAddress: _deliveryAddress,
user: isFromPackages
? User(
id: _carton.userID,
name: _carton.userName)
: User(
id: _carton.receiverID,
name: _carton.receiverName),
user: User(
id: _carton.userID, name: _carton.userName),
)),
);
if (d == null) return;
@@ -334,9 +328,9 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
}
if (isFromCartons) {
carton.receiverID = _carton.receiverID;
carton.receiverFCSID = _carton.receiverFCSID;
carton.receiverName = _carton.receiverName;
carton.userID = _carton.userID;
carton.fcsID = _carton.fcsID;
carton.userName = _carton.userName;
carton.senderID = _carton.senderID;
carton.senderFCSID = _carton.senderFCSID;
carton.senderName = _carton.senderName;