add carton editor to update

This commit is contained in:
tzw
2024-02-09 17:10:19 +06:30
parent 2d912a20aa
commit a246097d05
9 changed files with 103 additions and 45 deletions

View File

@@ -14,6 +14,7 @@ import '../../domain/entities/cargo_type.dart';
import '../../domain/entities/carton.dart';
import '../../domain/entities/package.dart';
import '../../domain/entities/user.dart';
import '../fcs_shipment/model/fcs_shipment_model.dart';
import '../main/util.dart';
import '../widgets/local_text.dart';
import '../widgets/progress.dart';
@@ -64,20 +65,37 @@ class _CartonPackageEditorState extends State<CartonPackageEditor> {
@override
void initState() {
_init();
super.initState();
}
_init() async {
_sender = User(
name: "ptd-phyo44 kaelone",
fcsID: "FCS-8X6V",
phoneNumber: "+959444444444",
id: "48u_4s-HiQeW-HwSqeRd9TSMWh3mLZfSk5rpaUEh_zw");
name: widget.carton.senderName,
fcsID: widget.carton.senderFCSID,
id: widget.carton.senderID);
_consignee = User(
id: "HsIwG88K-0_HSazgEy5QR27kcjkOvfv7_Sr1JP18Q1A",
name: "One One",
phoneNumber: "+959111111111",
fcsID: "FCS-EFRF");
id: widget.carton.userID,
name: widget.carton.userName,
fcsID: widget.carton.fcsID);
_billToValue = widget.carton.billTo ?? billToSender;
_selectedDeliveryType = delivery_caton;
_cartonSizeType = customCarton;
_length = widget.carton.length;
_width = widget.carton.width;
_height = widget.carton.height;
var s = await context
.read<FcsShipmentModel>()
.getFcsShipment(widget.carton.fcsShipmentID ?? "");
_shipment = s;
context.read<PackageSelectionModel>().clearSelection();
super.initState();
if (mounted) {
setState(() {});
}
}
@override
@@ -116,7 +134,7 @@ class _CartonPackageEditorState extends State<CartonPackageEditor> {
},
),
backgroundColor: Colors.white,
title: LocalText(context, 'boxes.new',
title: LocalText(context, 'box.update_title',
color: primaryColor, fontSize: 20),
),
body: Column(
@@ -220,6 +238,7 @@ class _CartonPackageEditorState extends State<CartonPackageEditor> {
} else {
return Expanded(
child: CartonSubmit(
isNew: false,
sender: _sender!,
consingee: _consignee!,
billToValue: _billToValue,