update cartion editor for package
This commit is contained in:
@@ -8,6 +8,7 @@ import '../../../domain/entities/carton.dart';
|
||||
import '../../../domain/entities/carton_size.dart';
|
||||
import '../../../domain/entities/fcs_shipment.dart';
|
||||
import '../../../helpers/theme.dart';
|
||||
import '../../main/util.dart';
|
||||
import '../../widgets/local_text.dart';
|
||||
import '../../widgets/previous_button.dart';
|
||||
import '../../widgets/submit_text_widget.dart';
|
||||
@@ -47,6 +48,7 @@ class _MixCartonSubmitState extends State<MixCartonSubmit> {
|
||||
final NumberFormat numberFormatter = NumberFormat("#,###");
|
||||
Map<String?, double> _mapCargosByWeight = {};
|
||||
Map<String?, double> _mapCargosByCustomDutyFee = {};
|
||||
double totalWeight = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -69,6 +71,9 @@ class _MixCartonSubmitState extends State<MixCartonSubmit> {
|
||||
_mapCargosByWeight[key] = total;
|
||||
});
|
||||
|
||||
totalWeight =
|
||||
_mapCargosByWeight.entries.fold(0, (sum, value) => sum + value.value);
|
||||
|
||||
// get cargos by custom duty fee
|
||||
Map<String?, List<CargoType>> _cargosByCustomDutyFee =
|
||||
groupCargos(_cargoTypes.where((e) => e.isCutomDuty).toList());
|
||||
@@ -104,7 +109,7 @@ class _MixCartonSubmitState extends State<MixCartonSubmit> {
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: SubmitTextWidget(
|
||||
labelKey: 'box.carton.type',
|
||||
text: 'Mix Carton',
|
||||
text: carton_mix_carton,
|
||||
subText: boxDimension,
|
||||
),
|
||||
);
|
||||
@@ -159,9 +164,18 @@ class _MixCartonSubmitState extends State<MixCartonSubmit> {
|
||||
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.cargo.type',
|
||||
color: primaryColor, fontSize: 16, fontWeight: FontWeight.normal),
|
||||
padding: const EdgeInsets.only(left: 5, bottom: 5, right: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
LocalText(context, 'box.cargo.type',
|
||||
color: primaryColor,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.normal),
|
||||
Text("${removeTrailingZeros(totalWeight)} lb",
|
||||
style: TextStyle(color: Colors.black, fontSize: 15))
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -185,7 +199,7 @@ class _MixCartonSubmitState extends State<MixCartonSubmit> {
|
||||
style:
|
||||
TextStyle(color: Colors.black, fontSize: 15),
|
||||
),
|
||||
Text("${numberFormatter.format(e.value)} lb",
|
||||
Text("${removeTrailingZeros(e.value)} lb",
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: 15))
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user