2020-10-18 02:38:46 +06:30
|
|
|
import 'package:fcs/domain/entities/carton.dart';
|
2020-10-19 05:13:49 +06:30
|
|
|
import 'package:fcs/helpers/theme.dart';
|
2020-10-14 13:54:42 +06:30
|
|
|
import 'package:flutter/cupertino.dart';
|
2020-06-26 16:17:40 +06:30
|
|
|
import 'package:flutter/material.dart';
|
2021-09-10 12:00:08 +06:30
|
|
|
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
2020-06-26 16:17:40 +06:30
|
|
|
import 'package:intl/intl.dart';
|
2024-02-09 13:49:18 +06:30
|
|
|
import '../carton_info.dart';
|
2024-02-26 17:26:25 +06:30
|
|
|
import '../print_qr_code_page.dart';
|
2020-10-07 02:33:06 +06:30
|
|
|
|
2020-10-21 02:59:10 +06:30
|
|
|
class CartonListRow extends StatelessWidget {
|
2021-09-10 16:33:52 +06:30
|
|
|
final Carton box;
|
|
|
|
|
CartonListRow({Key? key, required this.box}) : super(key: key);
|
2020-06-26 16:17:40 +06:30
|
|
|
|
|
|
|
|
final double dotSize = 15.0;
|
|
|
|
|
final DateFormat dateFormat = new DateFormat("dd MMM yyyy");
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2020-10-19 05:13:49 +06:30
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
2024-02-09 13:35:32 +06:30
|
|
|
CupertinoPageRoute(builder: (context) => CartonInfo(carton: box)),
|
2020-10-19 05:13:49 +06:30
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 15, right: 15),
|
2020-06-26 16:17:40 +06:30
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: new Padding(
|
2024-02-07 17:26:29 +06:30
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
2020-06-26 16:17:40 +06:30
|
|
|
child: new Row(
|
|
|
|
|
children: <Widget>[
|
2020-10-19 05:13:49 +06:30
|
|
|
Container(
|
2024-02-28 17:47:47 +06:30
|
|
|
padding: EdgeInsets.only(left: 0),
|
2020-10-19 05:13:49 +06:30
|
|
|
child: Icon(
|
|
|
|
|
MaterialCommunityIcons.package,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
size: 30,
|
|
|
|
|
),
|
|
|
|
|
),
|
2020-06-26 16:17:40 +06:30
|
|
|
new Expanded(
|
2024-02-01 18:07:40 +06:30
|
|
|
child: Padding(
|
2024-02-28 17:47:47 +06:30
|
|
|
padding: const EdgeInsets.only(left: 15.0),
|
2024-02-01 18:07:40 +06:30
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
new Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
new Text(
|
|
|
|
|
box.cartonNumber ?? "",
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 15.0, color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 5),
|
|
|
|
|
child: new Text(
|
2024-09-25 21:49:09 +06:30
|
|
|
box.consigneeName ?? "",
|
2024-02-01 18:07:40 +06:30
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 15.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2020-06-26 16:17:40 +06:30
|
|
|
),
|
2024-02-01 18:07:40 +06:30
|
|
|
const SizedBox(width: 15),
|
|
|
|
|
IconButton(
|
2024-02-22 17:16:19 +06:30
|
|
|
onPressed: () {
|
2024-02-26 17:26:25 +06:30
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
CupertinoPageRoute(
|
|
|
|
|
builder: (context) =>
|
|
|
|
|
PrintQrCodePage(carton: box)),
|
|
|
|
|
);
|
2024-02-22 17:16:19 +06:30
|
|
|
},
|
|
|
|
|
icon:
|
|
|
|
|
Icon(AntDesign.qrcode, color: Colors.black))
|
2024-02-01 18:07:40 +06:30
|
|
|
],
|
|
|
|
|
),
|
2020-06-26 16:17:40 +06:30
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
2024-02-01 18:07:40 +06:30
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
2020-06-26 16:17:40 +06:30
|
|
|
children: <Widget>[
|
2024-02-01 18:07:40 +06:30
|
|
|
Text(box.status ?? "",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
fontWeight: FontWeight.bold)),
|
2020-06-26 16:17:40 +06:30
|
|
|
Padding(
|
2024-02-01 18:07:40 +06:30
|
|
|
padding: const EdgeInsets.only(top: 5),
|
2020-06-26 16:17:40 +06:30
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
new Text(
|
2024-02-01 18:07:40 +06:30
|
|
|
"${box.cartonWeight.toStringAsFixed(2)} lb",
|
2020-06-26 16:17:40 +06:30
|
|
|
style:
|
2024-02-28 17:47:47 +06:30
|
|
|
new TextStyle(fontSize: 14.0, color: Colors.grey),
|
2020-06-26 16:17:40 +06:30
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|