fix issues
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
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/vo/delivery_address.dart';
|
||||
@@ -23,7 +22,6 @@ import 'package:provider/provider.dart';
|
||||
|
||||
import 'carton_cargo_table.dart';
|
||||
import 'carton_editor.dart';
|
||||
import 'carton_mix_table.dart';
|
||||
import 'carton_package_table.dart';
|
||||
import 'model/carton_model.dart';
|
||||
import 'widgets.dart';
|
||||
@@ -41,11 +39,6 @@ class CartonInfo extends StatefulWidget {
|
||||
class _CartonInfoState extends State<CartonInfo> {
|
||||
bool _isLoading = false;
|
||||
Carton _box;
|
||||
String _selectedCartonType;
|
||||
List<Package> _packages = [];
|
||||
List<Carton> _mixBoxes = [];
|
||||
Carton _selectedShipmentBox = new Carton();
|
||||
List<CargoType> _cargoTypes = [];
|
||||
DeliveryAddress _deliveryAddress = new DeliveryAddress();
|
||||
TextEditingController _widthController = new TextEditingController();
|
||||
TextEditingController _heightController = new TextEditingController();
|
||||
@@ -63,7 +56,6 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_box = widget.box;
|
||||
_selectedCartonType = _box.cartonType;
|
||||
|
||||
//for shipment weight
|
||||
volumetricRatio = Provider.of<ShipmentRateModel>(context, listen: false)
|
||||
@@ -81,7 +73,6 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
_widthController.text = _box.width.toString();
|
||||
_heightController.text = _box.height.toString();
|
||||
_lengthController.text = _box.length.toString();
|
||||
_cargoTypes = _box.cargoTypes;
|
||||
_deliveryAddress = _box.deliveryAddress;
|
||||
isMixBox = _box.cartonType == carton_mix_box;
|
||||
isFromShipments = _box.cartonType == carton_from_shipments;
|
||||
@@ -101,7 +92,8 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
List<Package> packages = await packageModel.getPackages(_box.userID, [
|
||||
package_processed_status,
|
||||
package_packed_status,
|
||||
package_shipped_status
|
||||
package_shipped_status,
|
||||
package_delivered_status
|
||||
]);
|
||||
packages = packages.where((p) => _box.packageIDs.contains(p.id)).toList();
|
||||
packages.forEach((p) {
|
||||
@@ -155,38 +147,6 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
iconData: Icons.person,
|
||||
);
|
||||
|
||||
final shipmentBoxTitle = Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 10.0, top: 20),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child:
|
||||
LocalText(context, 'box.shipment_number', color: Colors.grey),
|
||||
),
|
||||
LocalText(context, 'box.shipment.desc', color: Colors.grey),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
final shipmentBoxRow = Container(
|
||||
padding: EdgeInsets.only(left: 15.0, right: 10.0, top: 5.0, bottom: 5.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Text(
|
||||
_selectedShipmentBox.shipmentNumber == null
|
||||
? ""
|
||||
: _selectedShipmentBox.shipmentNumber,
|
||||
style: textStyle,
|
||||
)),
|
||||
new Text(
|
||||
_selectedShipmentBox.desc == null ? "" : _selectedShipmentBox.desc,
|
||||
style: textStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
final lengthBox = LengthPicker(
|
||||
controller: _lengthController,
|
||||
lableKey: "box.length",
|
||||
@@ -276,30 +236,6 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
packages: _box.packages,
|
||||
)
|
||||
: Container(),
|
||||
isFromPackages
|
||||
? Container()
|
||||
: isFromShipments
|
||||
? Column(
|
||||
children: [
|
||||
LocalTitle(textKey: "box.shipment.boxes"),
|
||||
shipmentBoxTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
shipmentBoxRow
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
// : _selectedCartonType == "Mix carton"
|
||||
// ? CartonMixTable(
|
||||
// cartons: _box.cartons,
|
||||
// onSelect: (c, check) {
|
||||
// setState(() {
|
||||
// c.isChecked = check;
|
||||
// });
|
||||
// },
|
||||
// )
|
||||
// : Container(),
|
||||
isMixBox ? Container() : LocalTitle(textKey: "box.cargo.type"),
|
||||
isMixBox ? Container() : cargoTableBox,
|
||||
...(isFromPackages
|
||||
|
||||
Reference in New Issue
Block a user