2020-12-10 20:06:15 +06:30
|
|
|
import 'package:fcs/domain/entities/carton.dart';
|
2024-02-26 17:26:25 +06:30
|
|
|
import 'package:flutter/cupertino.dart';
|
2020-12-10 20:06:15 +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-12-10 20:06:15 +06:30
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
|
|
2024-02-26 17:26:25 +06:30
|
|
|
import '../print_qr_code_page.dart';
|
|
|
|
|
|
2020-12-10 20:06:15 +06:30
|
|
|
class CartonRow extends StatelessWidget {
|
2024-02-26 17:26:25 +06:30
|
|
|
final Carton carton;
|
|
|
|
|
CartonRow({Key? key, required this.carton}) : super(key: key);
|
2020-12-10 20:06:15 +06:30
|
|
|
|
|
|
|
|
final double dotSize = 15.0;
|
|
|
|
|
final DateFormat dateFormat = new DateFormat("dd MMM yyyy");
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: BoxDecoration(
|
2024-02-01 18:07:40 +06:30
|
|
|
border: Border(bottom: BorderSide(color: Colors.grey.shade300)),
|
2020-12-10 20:06:15 +06:30
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: new Padding(
|
2024-02-01 18:07:40 +06:30
|
|
|
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
2020-12-10 20:06:15 +06:30
|
|
|
child: new Row(
|
|
|
|
|
children: <Widget>[
|
2024-02-26 17:26:25 +06:30
|
|
|
new Text(carton.cartonNumber ?? "",
|
2024-02-01 18:07:40 +06:30
|
|
|
style:
|
|
|
|
|
new TextStyle(fontSize: 15.0, color: Colors.black)),
|
|
|
|
|
const SizedBox(width: 15),
|
2024-02-26 17:26:25 +06:30
|
|
|
IconButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
CupertinoPageRoute(
|
|
|
|
|
builder: (context) =>
|
|
|
|
|
PrintQrCodePage(carton: carton)),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
icon: Icon(AntDesign.qrcode)),
|
2020-12-10 20:06:15 +06:30
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
2024-02-26 17:26:25 +06:30
|
|
|
carton.cartonWeight == 0
|
2020-12-10 20:06:15 +06:30
|
|
|
? Container()
|
|
|
|
|
: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0, bottom: 5),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
new Text(
|
2024-02-26 17:26:25 +06:30
|
|
|
"${carton.cartonWeight.toStringAsFixed(2)} lb",
|
2020-12-10 20:06:15 +06:30
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 15.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|