update carton form ,info and filter
This commit is contained in:
@@ -92,6 +92,8 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
_mixCartons = await context
|
||||
.read<CartonModel>()
|
||||
.getCartonsByIds(_carton.cartonIDs);
|
||||
_cargoTypes.sort((a, b) => a.name!.compareTo(b.name!));
|
||||
_surchareItems.sort((a, b) => a.name!.compareTo(b.name!));
|
||||
}
|
||||
|
||||
totalWeight =
|
||||
@@ -156,13 +158,17 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
);
|
||||
|
||||
final lastMileBox = DisplayText(
|
||||
text: _carton.lastMile == delivery_caton ? 'Delivery' : 'Pick-up',
|
||||
text: _carton.lastMile == delivery_caton
|
||||
? 'Delivery'
|
||||
: _carton.lastMile == pickup_carton
|
||||
? 'Pick-up'
|
||||
: '',
|
||||
labelTextKey: "box.delivery_type",
|
||||
);
|
||||
|
||||
final cartonSizeBox = DisplayText(
|
||||
subText: Text("${boxDimension ?? 'No defined size'}"),
|
||||
labelTextKey: "box.carton_size",
|
||||
labelTextKey: "box.select_carton_size",
|
||||
);
|
||||
|
||||
final senderBox = DisplayText(
|
||||
@@ -192,6 +198,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
|
||||
final userRowBox = Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Row(
|
||||
@@ -228,7 +235,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
);
|
||||
|
||||
final cargosBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -237,10 +244,13 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
color: Colors.black54,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.normal),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 50),
|
||||
child: Text("${removeTrailingZeros(totalWeight)} lb",
|
||||
style: TextStyle(color: Colors.black54, fontSize: 15)))
|
||||
_cargoTypes.isNotEmpty
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(right: 50),
|
||||
child: Text("${removeTrailingZeros(totalWeight)} lb",
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: Colors.black54, fontSize: 15)))
|
||||
: const SizedBox()
|
||||
],
|
||||
),
|
||||
Container(
|
||||
@@ -262,68 +272,52 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
TextStyle(color: Colors.black, fontSize: 15),
|
||||
),
|
||||
Text("${removeTrailingZeros(e.weight)} lb",
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: 15))
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
);
|
||||
final surchargeItemBox = Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
LocalText(context, 'box.surcharge.item',
|
||||
color: Colors.black54,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.normal),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 50),
|
||||
child: Text("${removeTrailingZeros(totalSurchargeCount)} pcs",
|
||||
style: TextStyle(color: Colors.black54, fontSize: 15)))
|
||||
],
|
||||
),
|
||||
Container(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 60),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: _surchareItems.map((e) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 3),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
e.name ?? "",
|
||||
|
||||
final surchargeItemBox =
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Container(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 50),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: _surchareItems.map((e) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 3),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
e.name ?? "",
|
||||
style: TextStyle(color: Colors.black, fontSize: 15),
|
||||
),
|
||||
Text("${removeTrailingZeros((e.qty).toDouble())} pc",
|
||||
textAlign: TextAlign.end,
|
||||
style:
|
||||
TextStyle(color: Colors.black, fontSize: 15),
|
||||
),
|
||||
Text(
|
||||
"${removeTrailingZeros((e.qty).toDouble())} pc",
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: 15))
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
TextStyle(color: Colors.black, fontSize: 15))
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
);
|
||||
),
|
||||
]);
|
||||
|
||||
final img = MultiImageFile(
|
||||
enabled: false,
|
||||
@@ -447,10 +441,13 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
],
|
||||
),
|
||||
),
|
||||
_cargoTypes.isEmpty ? const SizedBox() : cargosBox,
|
||||
_surchareItems.isEmpty ? const SizedBox() : surchargeItemBox,
|
||||
cargosBox,
|
||||
surchargeItemBox,
|
||||
const SizedBox(height: 10),
|
||||
uploadImageBtn,
|
||||
const SizedBox(height: 30),
|
||||
_carton.photoUrls.isNotEmpty
|
||||
? const SizedBox(height: 10)
|
||||
: const SizedBox(),
|
||||
img,
|
||||
_carton.photoUrls.isNotEmpty
|
||||
? const SizedBox(height: 40)
|
||||
|
||||
Reference in New Issue
Block a user