Merge branch 'master' of https://git.mokkon.com/tzw/fcs
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import 'package:fcs/domain/constants.dart';
|
import 'package:fcs/domain/constants.dart';
|
||||||
|
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||||
import 'package:fcs/domain/entities/carton.dart';
|
import 'package:fcs/domain/entities/carton.dart';
|
||||||
import 'package:fcs/domain/entities/package.dart';
|
import 'package:fcs/domain/entities/package.dart';
|
||||||
|
import 'package:fcs/domain/entities/pickup.dart';
|
||||||
import 'package:fcs/domain/vo/delivery_address.dart';
|
import 'package:fcs/domain/vo/delivery_address.dart';
|
||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
import 'package:fcs/pages/carton_size/model/carton_size_model.dart';
|
import 'package:fcs/pages/carton_size/model/carton_size_model.dart';
|
||||||
@@ -15,7 +17,10 @@ import 'package:fcs/pages/widgets/local_app_bar.dart';
|
|||||||
import 'package:fcs/pages/widgets/local_radio_buttons.dart';
|
import 'package:fcs/pages/widgets/local_radio_buttons.dart';
|
||||||
import 'package:fcs/pages/widgets/local_text.dart';
|
import 'package:fcs/pages/widgets/local_text.dart';
|
||||||
import 'package:fcs/pages/widgets/local_title.dart';
|
import 'package:fcs/pages/widgets/local_title.dart';
|
||||||
|
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
||||||
|
import 'package:fcs/pages/widgets/multi_img_file.dart';
|
||||||
import 'package:fcs/pages/widgets/progress.dart';
|
import 'package:fcs/pages/widgets/progress.dart';
|
||||||
|
import 'package:fcs/pages/widgets/status_tree.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||||
@@ -32,8 +37,10 @@ import 'widgets.dart';
|
|||||||
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
||||||
|
|
||||||
class CartonInfo extends StatefulWidget {
|
class CartonInfo extends StatefulWidget {
|
||||||
|
final Package? package;
|
||||||
final Carton? box;
|
final Carton? box;
|
||||||
CartonInfo({this.box});
|
|
||||||
|
CartonInfo({this.box,this.package});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_CartonInfoState createState() => _CartonInfoState();
|
_CartonInfoState createState() => _CartonInfoState();
|
||||||
@@ -42,7 +49,12 @@ class CartonInfo extends StatefulWidget {
|
|||||||
class _CartonInfoState extends State<CartonInfo> {
|
class _CartonInfoState extends State<CartonInfo> {
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
Carton? _box;
|
Carton? _box;
|
||||||
|
|
||||||
|
List<CargoType>? cargoTypes;
|
||||||
|
List<String> pickups=['203PVH','Fh290','HH211'];
|
||||||
|
Map<String,dynamic> cargos={"General":150,"Electronics":15};
|
||||||
DeliveryAddress? _deliveryAddress = new DeliveryAddress();
|
DeliveryAddress? _deliveryAddress = new DeliveryAddress();
|
||||||
|
MultiImgController multiImgController = MultiImgController();
|
||||||
TextEditingController _widthController = new TextEditingController();
|
TextEditingController _widthController = new TextEditingController();
|
||||||
TextEditingController _heightController = new TextEditingController();
|
TextEditingController _heightController = new TextEditingController();
|
||||||
TextEditingController _lengthController = new TextEditingController();
|
TextEditingController _lengthController = new TextEditingController();
|
||||||
@@ -57,11 +69,13 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
bool isSmallBag = false;
|
bool isSmallBag = false;
|
||||||
bool isFromCartons = false;
|
bool isFromCartons = false;
|
||||||
bool isEdiable = false;
|
bool isEdiable = false;
|
||||||
|
Package? _package;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_box = widget.box;
|
_box = widget.box;
|
||||||
|
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
|
||||||
@@ -74,6 +88,14 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
_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();
|
||||||
@@ -212,8 +234,8 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final consigneeNameBox = DisplayText(
|
final consigneeNameBox = DisplayText(
|
||||||
text: _box!.userName != null ? _box!.userName : "",
|
text: _box!.senderName != null ? _box!.senderName : "",
|
||||||
subText: Text(_box!.fcsID ?? "", style: textStyle),
|
subText: Text(_box!.senderFCSID ?? "", style: textStyle),
|
||||||
|
|
||||||
labelTextKey: "processing.consignee.name",
|
labelTextKey: "processing.consignee.name",
|
||||||
//maxLines: 2,
|
//maxLines: 2,
|
||||||
@@ -288,11 +310,21 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
final packageBox = DisplayText(
|
final packageBox = DisplayText(
|
||||||
text: "203FVH",
|
//text: "203FVH",
|
||||||
labelTextKey: "box.package",
|
labelTextKey: "box.package",
|
||||||
maxLines:20,
|
|
||||||
//iconData: AntDesign.CodeSandbox,
|
|
||||||
);
|
);
|
||||||
|
final img = MultiImageFile(
|
||||||
|
enabled: false,
|
||||||
|
controller: multiImgController,
|
||||||
|
title: "Receipt File",
|
||||||
|
);
|
||||||
|
final cargoBox = DisplayText(
|
||||||
|
//text: "203FVH",
|
||||||
|
labelTextKey: "box.cargo.type",
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
final cartonSizeBox = DisplayText(
|
final cartonSizeBox = DisplayText(
|
||||||
text: _cartonSizeController.text,
|
text: _cartonSizeController.text,
|
||||||
@@ -359,9 +391,9 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
]
|
]
|
||||||
: [],
|
: [],
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: Container(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child: ListView(shrinkWrap: true, children: <Widget>[
|
child: Row( children: <Widget>[
|
||||||
// Container(child: Row(children: [
|
// Container(child: Row(children: [
|
||||||
// Column(children: [
|
// Column(children: [
|
||||||
// LocalTitle(textKey: "box.type.title"),
|
// LocalTitle(textKey: "box.type.title"),
|
||||||
@@ -372,7 +404,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
// ],)
|
// ],)
|
||||||
// ]),),
|
// ]),),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 30),
|
padding: EdgeInsets.only(left: 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
@@ -394,7 +426,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
)),
|
)),
|
||||||
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 30),
|
padding: EdgeInsets.only(left: 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
@@ -408,7 +440,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 30),
|
padding: EdgeInsets.only(left: 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
@@ -424,6 +456,60 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
])),
|
])),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
|
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(
|
||||||
|
// itemCount: cargos.length,
|
||||||
|
// itemBuilder: (BuildContext context, int index) {
|
||||||
|
// return ListTile(
|
||||||
|
// title: Text(cargos[index].key));
|
||||||
|
|
||||||
|
// }),
|
||||||
|
|
||||||
|
Expanded(child:
|
||||||
|
Padding(padding: EdgeInsets.only(left: 200.0,right: 8.0),
|
||||||
|
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Color(0xff272262),
|
||||||
|
elevation: 3,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(5.0)),
|
||||||
|
minimumSize: Size(100, 35), //////// HERE
|
||||||
|
),
|
||||||
|
onPressed: (){},
|
||||||
|
child: const Text('Upload Images'),
|
||||||
|
),)),
|
||||||
|
Center(child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Color.fromARGB(255, 196, 39, 52),
|
||||||
|
elevation: 3,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(5.0)),
|
||||||
|
minimumSize: Size(300, 45), //////// HERE
|
||||||
|
),
|
||||||
|
onPressed: (){},
|
||||||
|
child: const Text('Delete Carton',style:TextStyle(fontSize: 20)),
|
||||||
|
),),
|
||||||
|
|
||||||
|
//_package!.photoUrls.length == 0 || _package!.photoUrls.isEmpty ? Container() : img,
|
||||||
|
|
||||||
|
// Padding(padding: EdgeInsets.only(left: 10.0),
|
||||||
|
// child: Column(children: [
|
||||||
|
// cargos.isEmpty?Container():
|
||||||
|
// Text(cargos[cargo].key),
|
||||||
|
// Text(cargos[cargo].value),
|
||||||
|
// ]),),
|
||||||
|
|
||||||
|
//_packageList,
|
||||||
|
|
||||||
//LocalTitle(textKey: "box.shipment_info"),
|
//LocalTitle(textKey: "box.shipment_info"),
|
||||||
// shipmentBox,
|
// shipmentBox,
|
||||||
@@ -446,38 +532,49 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
// ],
|
// ],
|
||||||
// )
|
// )
|
||||||
// : Container(),
|
// : Container(),
|
||||||
Padding(padding: EdgeInsets.only(left: 30), child: packageBox),
|
// Padding(padding: EdgeInsets.only(left: 10),
|
||||||
isMixBox ? mixTypeBox : Container(),
|
// child: Row(children:[
|
||||||
isMixBox ? LocalTitle(textKey: "box.mix_caton_title") : Container(),
|
|
||||||
isMixBox
|
// ListView.builder(
|
||||||
? Column(children: _getCartons(context, _box!.mixCartons))
|
// itemCount: pickups.length,
|
||||||
: Container(),
|
// itemBuilder: (context, index) {
|
||||||
isFromPackages || isSmallBag
|
// return ListTile(
|
||||||
? CartonPackageTable(
|
// title: Text(pickups[index]),
|
||||||
packages: _box!.packages,
|
// );
|
||||||
)
|
// },)
|
||||||
: Container(),
|
|
||||||
|
// ])),
|
||||||
|
// // 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() : LocalTitle(textKey: "box.cargo.type"),
|
||||||
isMixBox ? Container() : cargoTableBox,
|
// isMixBox ? Container() : cargoTableBox,
|
||||||
...(isFromPackages || isFromCartons
|
// ...(isFromPackages || isFromCartons
|
||||||
? [
|
// ? [
|
||||||
LocalTitle(textKey: "box.dimension"),
|
// LocalTitle(textKey: "box.dimension"),
|
||||||
cartonSizeBox,
|
// cartonSizeBox,
|
||||||
dimBox,
|
// dimBox,
|
||||||
]
|
// ]
|
||||||
: []),
|
// : []),
|
||||||
isMixBox
|
// isMixBox
|
||||||
? Container()
|
// ? Container()
|
||||||
: LocalTitle(textKey: "box.delivery_address"),
|
// : LocalTitle(textKey: "box.delivery_address"),
|
||||||
isMixBox
|
// isMixBox
|
||||||
? Container()
|
// ? Container()
|
||||||
: DefaultDeliveryAddress(
|
// : DefaultDeliveryAddress(
|
||||||
deliveryAddress: _deliveryAddress,
|
// deliveryAddress: _deliveryAddress,
|
||||||
labelKey: "box.delivery_address",
|
// labelKey: "box.delivery_address",
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
)
|
// )
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -530,4 +627,18 @@ class _CartonInfoState extends State<CartonInfo> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Widget _packageList(BuildContext context) {
|
||||||
|
return ListView.builder(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
itemCount: pickups.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Container(
|
||||||
|
height: 50,
|
||||||
|
//color: Colors.amber[pickups[index]],
|
||||||
|
child: Center(child: Text('Entry ${pickups[index]}')),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
//separatorBuilder: (BuildContext context, int index) => const Divider(),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user