2020-10-15 03:06:13 +06:30
|
|
|
import 'package:fcs/domain/entities/shipment.dart';
|
2020-10-07 02:33:06 +06:30
|
|
|
import 'package:fcs/helpers/theme.dart';
|
2020-10-14 13:54:42 +06:30
|
|
|
import 'package:flutter/cupertino.dart';
|
2020-05-29 15:54:26 +06:30
|
|
|
import 'package:flutter/material.dart';
|
2021-09-10 16:48:21 +06:30
|
|
|
import 'package:flutter_icons_null_safety/flutter_icons_null_safety.dart';
|
2020-05-29 15:54:26 +06:30
|
|
|
|
2020-10-07 02:33:06 +06:30
|
|
|
import '../main/util.dart';
|
2020-10-16 10:58:31 +06:30
|
|
|
import 'shipment_info.dart';
|
2020-05-29 15:54:26 +06:30
|
|
|
|
2020-10-18 02:38:46 +06:30
|
|
|
class ShipmentListRow extends StatelessWidget {
|
2021-09-10 16:48:21 +06:30
|
|
|
final Shipment? shipment;
|
|
|
|
|
final bool? isCustomer;
|
|
|
|
|
const ShipmentListRow({Key? key, this.shipment, this.isCustomer})
|
2020-10-19 05:13:49 +06:30
|
|
|
: super(key: key);
|
2020-05-29 15:54:26 +06:30
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2020-10-18 02:38:46 +06:30
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).push(CupertinoPageRoute(
|
2020-10-19 05:13:49 +06:30
|
|
|
builder: (context) => ShipmentInfo(
|
2020-10-21 05:40:58 +06:30
|
|
|
shipment: shipment,
|
2020-10-19 05:13:49 +06:30
|
|
|
isCustomer: isCustomer,
|
|
|
|
|
)));
|
2020-10-18 02:38:46 +06:30
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 15, right: 15),
|
2020-05-31 15:00:11 +06:30
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: new Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
|
|
|
|
child: new Row(
|
|
|
|
|
children: <Widget>[
|
2020-06-01 14:42:42 +06:30
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(5.0),
|
|
|
|
|
child: Icon(
|
2020-06-03 00:42:31 +06:30
|
|
|
SimpleLineIcons.direction,
|
2020-06-01 14:42:42 +06:30
|
|
|
color: primaryColor,
|
|
|
|
|
)),
|
2020-05-31 15:00:11 +06:30
|
|
|
new Expanded(
|
|
|
|
|
child: new Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
2021-09-10 16:48:21 +06:30
|
|
|
shipment!.shipmentNumber ?? "",
|
2020-05-31 15:00:11 +06:30
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 15.0, color: Colors.black),
|
2020-05-29 15:54:26 +06:30
|
|
|
),
|
2020-05-31 15:00:11 +06:30
|
|
|
),
|
2020-10-21 05:40:58 +06:30
|
|
|
// Padding(
|
|
|
|
|
// padding: const EdgeInsets.only(left: 10.0, top: 3),
|
|
|
|
|
// child: new Text(
|
|
|
|
|
// "Last ${shipment.last ?? 0} days",
|
|
|
|
|
// style: new TextStyle(
|
|
|
|
|
// fontSize: 15.0, color: Colors.grey),
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
2020-05-31 15:00:11 +06:30
|
|
|
],
|
2020-05-29 15:54:26 +06:30
|
|
|
),
|
2020-05-31 15:00:11 +06:30
|
|
|
),
|
|
|
|
|
],
|
2020-05-29 15:54:26 +06:30
|
|
|
),
|
|
|
|
|
),
|
2020-05-31 15:00:11 +06:30
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(0),
|
2021-09-10 16:48:21 +06:30
|
|
|
child: getStatus(shipment!.status ?? ""),
|
2020-05-31 15:00:11 +06:30
|
|
|
),
|
2020-10-19 05:13:49 +06:30
|
|
|
// Padding(
|
|
|
|
|
// padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
|
|
|
|
|
// child: Row(
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// new Text(
|
|
|
|
|
// "(${pickUp.totalWeight ?? "0"}) lb ",
|
|
|
|
|
// style:
|
|
|
|
|
// new TextStyle(fontSize: 15.0, color: Colors.grey),
|
|
|
|
|
// ),
|
|
|
|
|
// new Text(
|
|
|
|
|
// "(${pickUp.totalCount ?? "0"}) cartons ",
|
|
|
|
|
// style:
|
|
|
|
|
// new TextStyle(fontSize: 15.0, color: Colors.grey),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
2020-05-31 15:00:11 +06:30
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
2020-05-29 15:54:26 +06:30
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|