update carton and cargo type
This commit is contained in:
114
lib/pages/carton/mix_carton_detail_list.dart
Normal file
114
lib/pages/carton/mix_carton_detail_list.dart
Normal file
@@ -0,0 +1,114 @@
|
||||
import 'package:fcs/domain/entities/carton.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../widgets/local_text.dart';
|
||||
import 'carton_info.dart';
|
||||
|
||||
class MixCartonDetailList extends StatelessWidget {
|
||||
final String cartonNumber;
|
||||
final List<Carton> cartons;
|
||||
MixCartonDetailList(
|
||||
{super.key, required this.cartonNumber, required this.cartons});
|
||||
|
||||
final NumberFormat numberFormatter = NumberFormat("#,###");
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: LocalAppBar(
|
||||
backgroundColor: Colors.white,
|
||||
arrowColor: primaryColor,
|
||||
labelColor: primaryColor,
|
||||
titleWidget: Column(
|
||||
children: [
|
||||
LocalText(
|
||||
context,
|
||||
"box.cartion.count",
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
translationVariables: [numberFormatter.format(cartons.length)],
|
||||
),
|
||||
Text(cartonNumber,
|
||||
style: TextStyle(fontSize: 15, color: Colors.black))
|
||||
],
|
||||
),
|
||||
),
|
||||
body: ListView.separated(
|
||||
separatorBuilder: (context, index) =>
|
||||
Divider(height: 1, color: dividerColor),
|
||||
itemCount: cartons.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var carton = cartons[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => CartonInfo(carton: carton)),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(MaterialCommunityIcons.package,
|
||||
color: primaryColor),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
carton.cartonNumber == null
|
||||
? ''
|
||||
: carton.cartonNumber!,
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.black),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
carton.consigneeName ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.grey),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${carton.cartonWeight.toStringAsFixed(2)} lb",
|
||||
style: TextStyle(fontSize: 14.0, color: Colors.grey),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user