Merge branch 'master' of https://git.mokkon.com/tzw/fcs
This commit is contained in:
@@ -38,9 +38,9 @@ final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
|||||||
|
|
||||||
class CartonInfo extends StatefulWidget {
|
class CartonInfo extends StatefulWidget {
|
||||||
final Package? package;
|
final Package? package;
|
||||||
final Carton? box;
|
final Carton box;
|
||||||
|
|
||||||
CartonInfo({this.box,this.package});
|
CartonInfo({required this.box,this.package});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_CartonInfoState createState() => _CartonInfoState();
|
_CartonInfoState createState() => _CartonInfoState();
|
||||||
@@ -50,10 +50,9 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
Carton? _box;
|
Carton? _box;
|
||||||
|
|
||||||
|
|
||||||
List<CargoType>? cargoTypes;
|
List<CargoType>? cargoTypes;
|
||||||
List<String> pickups=['203PVH','Fh290','HH211'];
|
DeliveryAddress? _deliveryAddress = new DeliveryAddress();
|
||||||
Map<String,dynamic> cargos={"General":150,"Electronics":15};
|
|
||||||
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();
|
||||||
@@ -70,12 +69,20 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
bool isFromCartons = false;
|
bool isFromCartons = false;
|
||||||
bool isEdiable = false;
|
bool isEdiable = false;
|
||||||
Package? _package;
|
Package? _package;
|
||||||
|
final List<Package> packages=[Package(packageType: "2303HH"),
|
||||||
|
Package(packageType: "540FH"),
|
||||||
|
Package(packageType: "440WFH"),
|
||||||
|
];
|
||||||
|
final List<CargoType> cargos=[CargoType(name: "Electronics"),
|
||||||
|
CargoType(name: "General"),
|
||||||
|
CargoType(name: "Dangerous"),
|
||||||
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_box = widget.box;
|
_box = widget.box;
|
||||||
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)
|
||||||
.rate
|
.rate
|
||||||
@@ -83,19 +90,12 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
_lengthController.addListener(_calShipmentWeight);
|
_lengthController.addListener(_calShipmentWeight);
|
||||||
_widthController.addListener(_calShipmentWeight);
|
_widthController.addListener(_calShipmentWeight);
|
||||||
_heightController.addListener(_calShipmentWeight);
|
_heightController.addListener(_calShipmentWeight);
|
||||||
|
//multiImgController.setImageUrls = _box.photoUrls;
|
||||||
_updateBoxData();
|
_updateBoxData();
|
||||||
_loadPackages();
|
_loadPackages();
|
||||||
_loadMixCartons();
|
_loadMixCartons();
|
||||||
}
|
}
|
||||||
initPackage(Package? package) {
|
|
||||||
|
|
||||||
if (package == null) return;
|
|
||||||
multiImgController.setImageUrls = package.photoUrls;
|
|
||||||
setState(() {
|
|
||||||
_package = package;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
_updateBoxData() {
|
_updateBoxData() {
|
||||||
_widthController.text = _box!.width.toString();
|
_widthController.text = _box!.width.toString();
|
||||||
@@ -314,6 +314,11 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
labelTextKey: "box.package",
|
labelTextKey: "box.package",
|
||||||
|
|
||||||
);
|
);
|
||||||
|
final subPackageBox=ListView(children: packages.map((pack)=>
|
||||||
|
Card(child: Row(children: [
|
||||||
|
Container(child:Text((pack.packageType).toString()))
|
||||||
|
]),)
|
||||||
|
).toList(),);
|
||||||
final img = MultiImageFile(
|
final img = MultiImageFile(
|
||||||
enabled: false,
|
enabled: false,
|
||||||
controller: multiImgController,
|
controller: multiImgController,
|
||||||
@@ -392,80 +397,116 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
: [],
|
: [],
|
||||||
),
|
),
|
||||||
body: Container(
|
body: Container(
|
||||||
|
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child: Row( children: <Widget>[
|
child: Column( children: <Widget>[
|
||||||
// Container(child: Row(children: [
|
|
||||||
// Column(children: [
|
|
||||||
// LocalTitle(textKey: "box.type.title"),
|
|
||||||
// Align(
|
|
||||||
// alignment: Alignment(-0.1,0.1),
|
|
||||||
// child: getCartonNumberStatus(context, _box!)),
|
|
||||||
|
|
||||||
// ],)
|
Row(children:[
|
||||||
// ]),),
|
Flexible(child:
|
||||||
Padding(
|
cartonTypeBox),
|
||||||
padding: EdgeInsets.only(left: 10),
|
Flexible(child:
|
||||||
child: Row(
|
cartonQrBox,
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: cartonTypeBox,
|
|
||||||
flex: 1,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: IconButton(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
iconSize: 30,
|
|
||||||
icon: const Icon( AntDesign.qrcode),
|
|
||||||
onPressed: () {
|
|
||||||
// ...
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
]),
|
||||||
)),
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Flexible(child: shipmentBox,),
|
||||||
|
Flexible(child: deliveryBox,),
|
||||||
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(left: 10),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: shipmentBox,
|
|
||||||
flex: 1,
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: deliveryBox,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(left: 10),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: customerNameBox,
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: consigneeNameBox,
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: Column(children: [
|
|
||||||
Icon(Ionicons.document_text_outline),
|
|
||||||
Text("Bill to", style: TextStyle(color: Colors.blue))
|
|
||||||
])),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
Padding(padding: EdgeInsets.only(left:10),
|
|
||||||
child: Flexible(child: packageBox)),
|
|
||||||
for(int pack=0;pack<pickups.length;pack++)
|
|
||||||
|
|
||||||
Padding(padding: EdgeInsets.only(left: 10.0),
|
],),
|
||||||
child:
|
Row(
|
||||||
Text(pickups[pack],style:TextStyle(fontSize: 15,color: Colors.black))
|
|
||||||
),
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
Padding(padding: EdgeInsets.only(left: 10),
|
children: [
|
||||||
child: cargoBox,),
|
Flexible(child: customerNameBox,),
|
||||||
|
Flexible(child: consigneeNameBox),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
]),
|
||||||
|
packageBox,
|
||||||
|
Column(children:
|
||||||
|
getPackageList(packages),
|
||||||
|
),
|
||||||
|
Column(children: getCargoList(cargos),),
|
||||||
|
//subPackageBox,
|
||||||
|
|
||||||
|
|
||||||
|
// packages.map((pack)=>
|
||||||
|
// Card(child: Row(children: [
|
||||||
|
// Container(child:Text(pack.packageType,))
|
||||||
|
// ]),)
|
||||||
|
// ).toList(),
|
||||||
|
|
||||||
|
// flex: 1,
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// child: IconButton(
|
||||||
|
// alignment: Alignment.centerLeft,
|
||||||
|
// iconSize: 30,
|
||||||
|
// icon: const Icon( AntDesign.qrcode),
|
||||||
|
// onPressed: () {
|
||||||
|
// // ...
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
// ],
|
||||||
|
// )),
|
||||||
|
|
||||||
|
// Padding(
|
||||||
|
// padding: EdgeInsets.only(left: 10),
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Expanded(
|
||||||
|
// child: shipmentBox,
|
||||||
|
// flex: 1,
|
||||||
|
// ),
|
||||||
|
// Flexible(
|
||||||
|
// child: deliveryBox,
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// )),
|
||||||
|
// Padding(
|
||||||
|
// padding: EdgeInsets.only(left: 10),
|
||||||
|
// child: Row(
|
||||||
|
// children: [
|
||||||
|
// Flexible(
|
||||||
|
// child: customerNameBox,
|
||||||
|
// ),
|
||||||
|
// Column(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Row(
|
||||||
|
// children: [consigneeNameBox,Flexible(
|
||||||
|
// child: Column(children: [
|
||||||
|
// Icon(Ionicons.document_text_outline),
|
||||||
|
// Text("Bill to", style: TextStyle(color: Colors.blue))
|
||||||
|
// ])),],
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// // child: consigneeNameBox,
|
||||||
|
// ),
|
||||||
|
// // Flexible(
|
||||||
|
// // child: Column(children: [
|
||||||
|
// // Icon(Ionicons.document_text_outline),
|
||||||
|
// // Text("Bill to", style: TextStyle(color: Colors.blue))
|
||||||
|
// // ])),
|
||||||
|
// ],
|
||||||
|
// )),
|
||||||
|
// Padding(padding: EdgeInsets.only(left:10),
|
||||||
|
// child: Flexible(child: packageBox)),
|
||||||
|
//for(int pack=0;pack<pickups.length;pack++)
|
||||||
|
|
||||||
|
// Padding(padding: EdgeInsets.only(left: 10.0),
|
||||||
|
// child:
|
||||||
|
// Text(pickups[pack],style:TextStyle(fontSize: 15,color: Colors.black))
|
||||||
|
// ),
|
||||||
|
// Padding(padding: EdgeInsets.only(left: 10),
|
||||||
|
// child: cargoBox,),
|
||||||
// ListView.builder(
|
// ListView.builder(
|
||||||
// itemCount: cargos.length,
|
// itemCount: cargos.length,
|
||||||
// itemBuilder: (BuildContext context, int index) {
|
// itemBuilder: (BuildContext context, int index) {
|
||||||
@@ -474,7 +515,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
|
|
||||||
// }),
|
// }),
|
||||||
|
|
||||||
Expanded(child:
|
Flexible(child:
|
||||||
Padding(padding: EdgeInsets.only(left: 200.0,right: 8.0),
|
Padding(padding: EdgeInsets.only(left: 200.0,right: 8.0),
|
||||||
|
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
@@ -483,14 +524,15 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
elevation: 3,
|
elevation: 3,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(5.0)),
|
borderRadius: BorderRadius.circular(5.0)),
|
||||||
minimumSize: Size(100, 35), //////// HERE
|
minimumSize: Size(10, 35), //////// HERE
|
||||||
),
|
),
|
||||||
onPressed: (){},
|
onPressed: (){},
|
||||||
child: const Text('Upload Images'),
|
child: const Text('Upload Images'),
|
||||||
),)),
|
),)),
|
||||||
|
img,
|
||||||
Center(child: ElevatedButton(
|
Center(child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Color.fromARGB(255, 196, 39, 52),
|
backgroundColor:Color(0xffff0606),
|
||||||
elevation: 3,
|
elevation: 3,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(5.0)),
|
borderRadius: BorderRadius.circular(5.0)),
|
||||||
@@ -521,7 +563,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
// : Container(),
|
// : Container(),
|
||||||
// isMixBox
|
// isMixBox
|
||||||
// ? Container()
|
// ? Container()
|
||||||
// : isFromPackages
|
// : isFromPackages
|
||||||
// ? customerNameBox
|
// ? customerNameBox
|
||||||
// : Container(),
|
// : Container(),
|
||||||
// isFromCartons
|
// isFromCartons
|
||||||
@@ -575,10 +617,13 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
// SizedBox(
|
// SizedBox(
|
||||||
// height: 20,
|
// height: 20,
|
||||||
// )
|
// )
|
||||||
]),
|
])
|
||||||
),
|
)
|
||||||
),
|
)
|
||||||
);
|
// ])
|
||||||
|
// )
|
||||||
|
// )
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> _getCartons(BuildContext context, List<Carton> cartons) {
|
List<Widget> _getCartons(BuildContext context, List<Carton> cartons) {
|
||||||
@@ -586,6 +631,11 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
return CartonRow(box: c);
|
return CartonRow(box: c);
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
List<Widget> _getPackages(BuildContext context, List<Package> packages) {
|
||||||
|
return packages.map((p) {
|
||||||
|
return Text(p.packageType!);
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
|
||||||
_gotoEditor() async {
|
_gotoEditor() async {
|
||||||
_box!.mixCartons = _box!.mixCartons;
|
_box!.mixCartons = _box!.mixCartons;
|
||||||
@@ -627,18 +677,30 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Widget _packageList(BuildContext context) {
|
|
||||||
return ListView.builder(
|
List<Widget> getPackageList(List<Package> _p) {
|
||||||
padding: const EdgeInsets.all(8),
|
return _p.map((p) {
|
||||||
itemCount: pickups.length,
|
return Container(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
padding: EdgeInsets.only(top: 0),
|
||||||
return Container(
|
child: Container(
|
||||||
height: 50,
|
//padding:
|
||||||
//color: Colors.amber[pickups[index]],
|
//EdgeInsets.only(top: 0.0),
|
||||||
child: Center(child: Text('Entry ${pickups[index]}')),
|
child: Row(children:<Widget> [
|
||||||
);
|
new Text(p.packageType ?? '')
|
||||||
},
|
]),
|
||||||
//separatorBuilder: (BuildContext context, int index) => const Divider(),
|
));}).toList();
|
||||||
);
|
}
|
||||||
}
|
List<Widget> getCargoList(List<CargoType> _c) {
|
||||||
|
return _c.map((c) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(top: 0),
|
||||||
|
child: Container(
|
||||||
|
//padding:
|
||||||
|
//EdgeInsets.only(top: 0.0),
|
||||||
|
child: Row(children:<Widget> [
|
||||||
|
new Text(c.name ?? '')
|
||||||
|
]),
|
||||||
|
));}).toList();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user