update package detal list and update cargo type input in carton section
This commit is contained in:
@@ -7,8 +7,6 @@ import '../../../domain/entities/cargo_type.dart';
|
||||
import '../../../domain/entities/carton_size.dart';
|
||||
import '../../../domain/entities/fcs_shipment.dart';
|
||||
import '../../../helpers/theme.dart';
|
||||
|
||||
import '../../domain/entities/package.dart';
|
||||
import '../../domain/entities/user.dart';
|
||||
import '../main/util.dart';
|
||||
import '../widgets/local_text.dart';
|
||||
@@ -24,7 +22,7 @@ class CartonSubmit extends StatelessWidget {
|
||||
final User consingee;
|
||||
final String billToValue;
|
||||
final FcsShipment shipment;
|
||||
final List<Package> packages;
|
||||
// final List<Package> packages;
|
||||
final String cartonSizeType;
|
||||
final CartonSize? standardSize;
|
||||
final double length;
|
||||
@@ -44,7 +42,7 @@ class CartonSubmit extends StatelessWidget {
|
||||
this.onCreate,
|
||||
this.onPrevious,
|
||||
required this.shipment,
|
||||
this.packages = const [],
|
||||
// this.packages = const [],
|
||||
this.standardSize,
|
||||
required this.cartonSizeType,
|
||||
required this.lastMile,
|
||||
@@ -196,42 +194,42 @@ class CartonSubmit extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
|
||||
final packagesBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 5, bottom: 5),
|
||||
child: LocalText(context, 'box.package.count',
|
||||
translationVariables: [packages.length.toString()],
|
||||
color: primaryColor,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.normal),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: primaryColor),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Wrap(
|
||||
spacing: 15,
|
||||
children: packages.map((e) {
|
||||
return SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 2.5,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 3),
|
||||
child: Text(
|
||||
e.trackingID ?? "",
|
||||
style: TextStyle(color: Colors.black, fontSize: 15),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
),
|
||||
),
|
||||
]),
|
||||
);
|
||||
// final packagesBox = Padding(
|
||||
// padding: const EdgeInsets.only(top: 10),
|
||||
// child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 5, bottom: 5),
|
||||
// child: LocalText(context, 'box.package.count',
|
||||
// translationVariables: [packages.length.toString()],
|
||||
// color: primaryColor,
|
||||
// fontSize: 16,
|
||||
// fontWeight: FontWeight.normal),
|
||||
// ),
|
||||
// Container(
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border.all(color: primaryColor),
|
||||
// borderRadius: BorderRadius.circular(5),
|
||||
// ),
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Wrap(
|
||||
// spacing: 15,
|
||||
// children: packages.map((e) {
|
||||
// return SizedBox(
|
||||
// width: MediaQuery.of(context).size.width / 2.5,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.symmetric(vertical: 3),
|
||||
// child: Text(
|
||||
// e.trackingID ?? "",
|
||||
// style: TextStyle(color: Colors.black, fontSize: 15),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }).toList()),
|
||||
// ),
|
||||
// ),
|
||||
// ]),
|
||||
// );
|
||||
|
||||
final cargosBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
@@ -245,7 +243,8 @@ class CartonSubmit extends StatelessWidget {
|
||||
color: primaryColor,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.normal),
|
||||
Text("${removeTrailingZeros(totalWeight)} lb",
|
||||
Text(
|
||||
"${twoDecimalFormatted(double.tryParse(removeTrailingZeros(totalWeight)) ?? 0)} lb",
|
||||
style: TextStyle(color: Colors.black, fontSize: 15))
|
||||
],
|
||||
),
|
||||
@@ -275,7 +274,8 @@ class CartonSubmit extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: 15),
|
||||
),
|
||||
Text("${removeTrailingZeros(e.weight)} lb",
|
||||
Text(
|
||||
"${twoDecimalFormatted(double.tryParse(removeTrailingZeros(e.weight)) ?? 0)} lb",
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: 15))
|
||||
],
|
||||
@@ -448,11 +448,11 @@ class CartonSubmit extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
shipmentBox,
|
||||
const SizedBox(height: 10),
|
||||
packages.isNotEmpty ? packagesBox : const SizedBox(),
|
||||
// packages.isNotEmpty ? packagesBox : const SizedBox(),
|
||||
// const SizedBox(height: 10),
|
||||
cargoTypes.isNotEmpty ? cargosBox : const SizedBox(),
|
||||
const SizedBox(height: 10),
|
||||
cargosBox,
|
||||
const SizedBox(height: 10),
|
||||
surChargeItemsBox,
|
||||
surchareItems.isNotEmpty ? surChargeItemsBox : const SizedBox(),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user