707 lines
22 KiB
Dart
707 lines
22 KiB
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/package.dart';
|
|
import 'package:fcs/domain/entities/pickup.dart';
|
|
import 'package:fcs/domain/vo/delivery_address.dart';
|
|
import 'package:fcs/helpers/theme.dart';
|
|
import 'package:fcs/pages/carton_size/model/carton_size_model.dart';
|
|
import 'package:fcs/pages/main/util.dart';
|
|
import 'package:fcs/pages/package/model/package_model.dart';
|
|
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
|
import 'package:fcs/pages/widgets/defalut_delivery_address.dart';
|
|
import 'package:fcs/pages/widgets/display_text.dart';
|
|
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
|
import 'package:fcs/pages/widgets/length_picker.dart';
|
|
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
|
import 'package:fcs/pages/widgets/local_radio_buttons.dart';
|
|
import 'package:fcs/pages/widgets/local_text.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/status_tree.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
|
import 'package:intl/intl.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'cargo_table.dart';
|
|
import 'carton_editor.dart';
|
|
import 'carton_package_table.dart';
|
|
import 'carton_row.dart';
|
|
import 'model/carton_model.dart';
|
|
import 'widgets.dart';
|
|
|
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
|
|
|
class CartonInfo extends StatefulWidget {
|
|
final Package? package;
|
|
final Carton box;
|
|
|
|
CartonInfo({required this.box,this.package});
|
|
|
|
@override
|
|
_CartonInfoState createState() => _CartonInfoState();
|
|
}
|
|
|
|
class _CartonInfoState extends State<CartonInfo> {
|
|
bool _isLoading = false;
|
|
Carton? _box;
|
|
|
|
|
|
List<CargoType>? cargoTypes;
|
|
DeliveryAddress? _deliveryAddress = new DeliveryAddress();
|
|
MultiImgController multiImgController = MultiImgController();
|
|
TextEditingController _widthController = new TextEditingController();
|
|
TextEditingController _heightController = new TextEditingController();
|
|
TextEditingController _lengthController = new TextEditingController();
|
|
TextEditingController _cartonSizeController = new TextEditingController();
|
|
double volumetricRatio = 0;
|
|
double shipmentWeight = 0;
|
|
String? selectMixBoxType;
|
|
|
|
bool isMixBox = false;
|
|
bool isFromShipments = false;
|
|
bool isFromPackages = false;
|
|
bool isSmallBag = false;
|
|
bool isFromCartons = false;
|
|
bool isEdiable = false;
|
|
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
|
|
void initState() {
|
|
super.initState();
|
|
_box = widget.box;
|
|
//initPackage(widget.package!);
|
|
//for shipment weight
|
|
volumetricRatio = Provider.of<ShipmentRateModel>(context, listen: false)
|
|
.rate
|
|
.volumetricRatio;
|
|
_lengthController.addListener(_calShipmentWeight);
|
|
_widthController.addListener(_calShipmentWeight);
|
|
_heightController.addListener(_calShipmentWeight);
|
|
//multiImgController.setImageUrls = _box.photoUrls;
|
|
_updateBoxData();
|
|
_loadPackages();
|
|
_loadMixCartons();
|
|
}
|
|
|
|
|
|
_updateBoxData() {
|
|
_widthController.text = _box!.width.toString();
|
|
_heightController.text = _box!.height.toString();
|
|
_lengthController.text = _box!.length.toString();
|
|
_cartonSizeController.text = _box!.cartonSizeName ?? "";
|
|
_deliveryAddress = _box!.deliveryAddress;
|
|
isMixBox = _box!.cartonType == carton_mix_box;
|
|
isFromShipments = _box!.cartonType == carton_from_shipments;
|
|
isFromPackages = _box!.cartonType == carton_from_packages;
|
|
isSmallBag = _box!.cartonType == carton_small_bag;
|
|
isFromCartons = _box!.cartonType == carton_from_cartons;
|
|
|
|
isEdiable = (isFromPackages || isMixBox || isFromCartons) &&
|
|
_box!.status == carton_packed_status;
|
|
selectMixBoxType = _box!.mixBoxType;
|
|
getCartonSize();
|
|
}
|
|
|
|
getCartonSize() {
|
|
var cartonSizeModel = Provider.of<CartonSizeModel>(context, listen: false);
|
|
cartonSizeModel.cartonSizes.forEach((c) {
|
|
if (c.length == _box!.length &&
|
|
c.width == _box!.width &&
|
|
c.height == _box!.height) {
|
|
setState(() {
|
|
_cartonSizeController.text = c.name ?? "";
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
_loadPackages() async {
|
|
if (!isFromPackages && !isSmallBag) return;
|
|
|
|
if (_box!.cartonType == carton_from_packages && _box!.userID == null)
|
|
return;
|
|
PackageModel packageModel =
|
|
Provider.of<PackageModel>(context, listen: false);
|
|
List<Package> packages =
|
|
await packageModel.getPackages(_box!.userID ?? "", [
|
|
package_processed_status,
|
|
package_packed_status,
|
|
package_shipped_status,
|
|
package_delivered_status
|
|
]);
|
|
packages = packages.where((p) => _box!.packageIDs.contains(p.id)).toList();
|
|
packages.forEach((p) {
|
|
p.isChecked = true;
|
|
});
|
|
|
|
setState(() {
|
|
_box!.packages = packages;
|
|
});
|
|
}
|
|
|
|
_loadMixCartons() async {
|
|
if (_box!.cartonType != carton_mix_box) return;
|
|
CartonModel cartonModel = Provider.of<CartonModel>(context, listen: false);
|
|
List<Carton> catons = [];
|
|
for (var id in _box!.mixCartonIDs) {
|
|
Carton c = await cartonModel.getCarton(id);
|
|
catons.add(c);
|
|
}
|
|
|
|
setState(() {
|
|
_box!.mixCartons = catons;
|
|
});
|
|
}
|
|
|
|
_calShipmentWeight() {
|
|
double l = double.tryParse(_lengthController.text) ?? 0;
|
|
double w = double.tryParse(_widthController.text) ?? 0;
|
|
double h = double.tryParse(_heightController.text) ?? 0;
|
|
setState(() {
|
|
shipmentWeight = l * w * h / volumetricRatio;
|
|
});
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
super.dispose();
|
|
}
|
|
|
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var cartonModel = Provider.of<CartonModel>(context);
|
|
|
|
// final cartonTypeBox = LocalRadioButtons(
|
|
// readOnly: true,
|
|
// values: cartonModel.cartonTypesInfo,
|
|
// selectedValue: (_box!.isShipmentCarton ?? false)
|
|
// ? carton_from_shipments
|
|
// : _box!.cartonType);
|
|
final cartonTypeBox = DisplayText(
|
|
text: _box!.cartonNumber,
|
|
labelTextKey: "box.number",
|
|
//iconData: Ionicons.ios_airplane,
|
|
);
|
|
final cartonQrBox = DisplayText(
|
|
// text: _box!.,
|
|
//labelTextKey: "box.number",
|
|
iconData: AntDesign.qrcode,
|
|
);
|
|
final shipmentBox = DisplayText(
|
|
text: _box!.fcsShipmentNumber,
|
|
labelTextKey: "box.fcs_shipment_num",
|
|
// iconData: Ionicons.ios_airplane,
|
|
);
|
|
final deliveryBox = DisplayText(
|
|
text: "Delivery Carton",
|
|
labelTextKey: "box.delivery_type",
|
|
//icon: FcsIDIcon(),
|
|
);
|
|
|
|
final fcsIDBox = DisplayText(
|
|
text: _box!.fcsID == null ? "" : _box!.fcsID,
|
|
labelTextKey: "box.fcs.id",
|
|
//icon: FcsIDIcon(),
|
|
);
|
|
|
|
final customerNameBox = DisplayText(
|
|
text: _box!.userName == null ? "" : _box!.userName,
|
|
subText: Text(_box!.fcsID ?? "", style: textStyle),
|
|
labelTextKey: "box.name",
|
|
|
|
//iconData: Icons.person,
|
|
);
|
|
|
|
final consigneefcsIDBox = DisplayText(
|
|
text: _box!.fcsID != null ? _box!.fcsID : "",
|
|
labelTextKey: "processing.fcs.id",
|
|
icon: FcsIDIcon(),
|
|
);
|
|
|
|
final consigneeNameBox = DisplayText(
|
|
text: _box!.senderName != null ? _box!.senderName : "",
|
|
subText: Text(_box!.senderFCSID ?? "", style: textStyle),
|
|
|
|
labelTextKey: "processing.consignee.name",
|
|
//maxLines: 2,
|
|
// iconData: Ionicons.document_text_outline,
|
|
);
|
|
|
|
final consigneeBox = Container(
|
|
child: Column(
|
|
children: [
|
|
consigneeNameBox,
|
|
IconButton(icon:Icon(Ionicons.document_text_outline),
|
|
onPressed:() {},),
|
|
Text("Bill to",style:TextStyle(color:Color.fromARGB(255, 57, 80, 233)))
|
|
|
|
],
|
|
),
|
|
);
|
|
|
|
final shipperIDBox = Row(
|
|
children: <Widget>[
|
|
Expanded(
|
|
child: DisplayText(
|
|
text: _box!.senderFCSID,
|
|
labelTextKey: "processing.fcs.id",
|
|
icon: FcsIDIcon(),
|
|
)),
|
|
],
|
|
);
|
|
|
|
final shipperNamebox = DisplayText(
|
|
text: _box!.senderName,
|
|
labelTextKey: "processing.shipper.name",
|
|
maxLines: 2,
|
|
iconData: Icons.person,
|
|
);
|
|
|
|
final shipperBox = Container(
|
|
child: Column(
|
|
children: [
|
|
shipperIDBox,
|
|
shipperNamebox,
|
|
],
|
|
),
|
|
);
|
|
|
|
final lengthBox = LengthPicker(
|
|
controller: _lengthController,
|
|
lableKey: "box.length",
|
|
isReadOnly: true,
|
|
);
|
|
final widthBox = LengthPicker(
|
|
controller: _widthController,
|
|
lableKey: "box.width",
|
|
isReadOnly: true,
|
|
);
|
|
final heightBox = LengthPicker(
|
|
controller: _heightController,
|
|
lableKey: "box.height",
|
|
isReadOnly: true,
|
|
);
|
|
|
|
final dimBox = Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.only(right: 8.0),
|
|
child: Icon(FontAwesome.arrow_circle_right, color: primaryColor),
|
|
),
|
|
SizedBox(child: lengthBox, width: 80),
|
|
SizedBox(child: widthBox, width: 80),
|
|
SizedBox(child: heightBox, width: 80),
|
|
],
|
|
);
|
|
final packageBox = DisplayText(
|
|
//text: "203FVH",
|
|
labelTextKey: "box.package",
|
|
|
|
);
|
|
final subPackageBox=ListView(children: packages.map((pack)=>
|
|
Card(child: Row(children: [
|
|
Container(child:Text((pack.packageType).toString()))
|
|
]),)
|
|
).toList(),);
|
|
final img = MultiImageFile(
|
|
enabled: false,
|
|
controller: multiImgController,
|
|
title: "Receipt File",
|
|
);
|
|
final cargoBox = DisplayText(
|
|
//text: "203FVH",
|
|
labelTextKey: "box.cargo.type",
|
|
|
|
);
|
|
|
|
|
|
final cartonSizeBox = DisplayText(
|
|
text: _cartonSizeController.text,
|
|
labelTextKey: "box.carton_size",
|
|
iconData: AntDesign.CodeSandbox,
|
|
);
|
|
final cargoTableBox = CargoTable(
|
|
cargoTypes: _box!.cargoTypes,
|
|
);
|
|
// final mixCartonNumberBox = DisplayText(
|
|
// text: _box!.mixCartonNumber,
|
|
// labelTextKey: "box.mix.carton",
|
|
// iconData: MaterialCommunityIcons.package,
|
|
// );
|
|
|
|
final mixTypeBox = Container(
|
|
padding: EdgeInsets.only(top: 20),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
padding: EdgeInsets.only(left: 5),
|
|
child: LocalText(
|
|
context,
|
|
"box.mix_type",
|
|
color: primaryColor,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.bold,
|
|
)),
|
|
Row(
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Icon(
|
|
Icons.check,
|
|
color: primaryColor,
|
|
),
|
|
),
|
|
Text(selectMixBoxType ?? "")
|
|
],
|
|
)
|
|
],
|
|
),
|
|
);
|
|
|
|
return LocalProgress(
|
|
inAsyncCall: _isLoading,
|
|
child: Scaffold(
|
|
appBar: LocalAppBar(
|
|
labelKey: "box.info.title",
|
|
backgroundColor: Colors.white,
|
|
labelColor: primaryColor,
|
|
arrowColor: primaryColor,
|
|
actions: isEdiable
|
|
? <Widget>[
|
|
IconButton(
|
|
icon: Icon(Icons.edit, color: primaryColor),
|
|
onPressed: _gotoEditor,
|
|
),
|
|
IconButton(
|
|
icon: Icon(Icons.delete, color: primaryColor),
|
|
onPressed: _delete,
|
|
),
|
|
]
|
|
: [],
|
|
),
|
|
body: Container(
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
child: Column( children: <Widget>[
|
|
|
|
Row(children:[
|
|
Flexible(child:
|
|
cartonTypeBox),
|
|
Flexible(child:
|
|
cartonQrBox,
|
|
),
|
|
]),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Flexible(child: shipmentBox,),
|
|
Flexible(child: deliveryBox,),
|
|
|
|
|
|
],),
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: [
|
|
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(
|
|
// itemCount: cargos.length,
|
|
// itemBuilder: (BuildContext context, int index) {
|
|
// return ListTile(
|
|
// title: Text(cargos[index].key));
|
|
|
|
// }),
|
|
|
|
Flexible(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(10, 35), //////// HERE
|
|
),
|
|
onPressed: (){},
|
|
child: const Text('Upload Images'),
|
|
),)),
|
|
img,
|
|
Center(child: ElevatedButton(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor:Color(0xffff0606),
|
|
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"),
|
|
// shipmentBox,
|
|
// isSmallBag ? mixCartonNumberBox : Container(),
|
|
// isMixBox
|
|
// ? Container()
|
|
// : isFromPackages
|
|
// ? fcsIDBox
|
|
// : Container(),
|
|
// isMixBox
|
|
// ? Container()
|
|
// : isFromPackages
|
|
// ? customerNameBox
|
|
// : Container(),
|
|
// isFromCartons
|
|
// ? Row(
|
|
// children: [
|
|
// Flexible(child: consigneeBox),
|
|
// Flexible(child: shipperBox)
|
|
// ],
|
|
// )
|
|
// : Container(),
|
|
// Padding(padding: EdgeInsets.only(left: 10),
|
|
// child: Row(children:[
|
|
|
|
// ListView.builder(
|
|
// itemCount: pickups.length,
|
|
// itemBuilder: (context, index) {
|
|
// return ListTile(
|
|
// title: Text(pickups[index]),
|
|
// );
|
|
// },)
|
|
|
|
// ])),
|
|
// // 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() : cargoTableBox,
|
|
// ...(isFromPackages || isFromCartons
|
|
// ? [
|
|
// LocalTitle(textKey: "box.dimension"),
|
|
// cartonSizeBox,
|
|
// dimBox,
|
|
// ]
|
|
// : []),
|
|
// isMixBox
|
|
// ? Container()
|
|
// : LocalTitle(textKey: "box.delivery_address"),
|
|
// isMixBox
|
|
// ? Container()
|
|
// : DefaultDeliveryAddress(
|
|
// deliveryAddress: _deliveryAddress,
|
|
// labelKey: "box.delivery_address",
|
|
// ),
|
|
// SizedBox(
|
|
// height: 20,
|
|
// )
|
|
])
|
|
)
|
|
)
|
|
// ])
|
|
// )
|
|
// )
|
|
);
|
|
}
|
|
|
|
List<Widget> _getCartons(BuildContext context, List<Carton> cartons) {
|
|
return cartons.map((c) {
|
|
return CartonRow(box: c);
|
|
}).toList();
|
|
}
|
|
List<Widget> _getPackages(BuildContext context, List<Package> packages) {
|
|
return packages.map((p) {
|
|
return Text(p.packageType!);
|
|
}).toList();
|
|
}
|
|
|
|
_gotoEditor() async {
|
|
_box!.mixCartons = _box!.mixCartons;
|
|
bool? updated = await Navigator.push<bool>(
|
|
context,
|
|
CupertinoPageRoute(builder: (context) => CartonEditor(carton: _box)),
|
|
);
|
|
if (updated ?? false) {
|
|
var cartonModel = Provider.of<CartonModel>(context, listen: false);
|
|
var c = await cartonModel.getCarton(widget.box!.id ?? "");
|
|
setState(() {
|
|
_box = c;
|
|
_loadPackages();
|
|
_loadMixCartons();
|
|
_updateBoxData();
|
|
});
|
|
}
|
|
}
|
|
|
|
_delete() {
|
|
showConfirmDialog(context, "box.delete.confirm", () {
|
|
_deleteCarton();
|
|
});
|
|
}
|
|
|
|
_deleteCarton() async {
|
|
setState(() {
|
|
_isLoading = true;
|
|
});
|
|
try {
|
|
var cartonModel = Provider.of<CartonModel>(context, listen: false);
|
|
await cartonModel.deleteCarton(widget.box!);
|
|
Navigator.pop(context, true);
|
|
} catch (e) {
|
|
showMsgDialog(context, "Error", e.toString());
|
|
} finally {
|
|
setState(() {
|
|
_isLoading = false;
|
|
});
|
|
}
|
|
}
|
|
|
|
List<Widget> getPackageList(List<Package> _p) {
|
|
return _p.map((p) {
|
|
return Container(
|
|
padding: EdgeInsets.only(top: 0),
|
|
child: Container(
|
|
//padding:
|
|
//EdgeInsets.only(top: 0.0),
|
|
child: Row(children:<Widget> [
|
|
new Text(p.packageType ?? '')
|
|
]),
|
|
));}).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();
|
|
}
|
|
|
|
}
|