update carton
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
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_size.dart';
|
||||
import 'package:fcs/domain/entities/package.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';
|
||||
@@ -88,6 +90,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
(isFromPackages || isSmallBag) &&
|
||||
_box.status == carton_packed_status;
|
||||
selectMixBoxType = _box.mixBoxType ?? "Mix Delivery";
|
||||
getCartonSize();
|
||||
_cartons = [
|
||||
Carton(
|
||||
cartonNumber: "A100B-1#1",
|
||||
@@ -100,6 +103,20 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
];
|
||||
}
|
||||
|
||||
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) {
|
||||
print(c.name);
|
||||
setState(() {
|
||||
_cartonSizeController.text = c.name;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_loadPackages() async {
|
||||
if (!isFromPackages && !isSmallBag) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user