update cargo type form from rate, update carton info and form

This commit is contained in:
tzw
2024-09-25 21:49:09 +06:30
parent 1be18c08a9
commit 02e079c514
51 changed files with 1407 additions and 643 deletions

View File

@@ -56,7 +56,9 @@ class _CartonEditorState extends State<CartonEditor> {
_isNew = false;
_consignee = User(
id: _carton!.userID, fcsID: _carton!.fcsID, name: _carton!.userName);
id: _carton!.consigneeID,
fcsID: _carton!.consigneeFCSID,
name: _carton!.consigneeName);
_sender = User(
id: _carton!.senderID,
fcsID: _carton!.senderFCSID,
@@ -129,7 +131,7 @@ class _CartonEditorState extends State<CartonEditor> {
padding: const EdgeInsets.only(right: 5),
child: InkResponse(
radius: 30,
onTap: () {
onTap: () async {
//for packages
if (isFromPackages) {
if (_sender == null) {
@@ -149,20 +151,32 @@ class _CartonEditorState extends State<CartonEditor> {
return;
}
Navigator.push(
Carton? carton = await Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => CartonPackageForm(
sender: _sender!,
consignee: _consignee!,
)));
if (carton != null) {
setState(() {
_cartons.add(carton);
});
}
}
// for mix cartion
else {
Navigator.push(
Carton? carton = await Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => const MixCartonForm()));
if (carton != null) {
setState(() {
_cartons.add(carton);
});
}
}
},
child: Icon(Icons.add_circle, color: primaryColor),