116 lines
4.5 KiB
Dart
116 lines
4.5 KiB
Dart
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 '../main/util.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(
|
|
"${twoDecimalFormatted(carton.cartonWeight)} lb",
|
|
style: TextStyle(fontSize: 14.0, color: Colors.grey),
|
|
)
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
));
|
|
}
|
|
}
|