Files
fcs/lib/pages/shipment/shipment_list_row.dart
2020-10-19 05:13:49 +06:30

101 lines
3.5 KiB
Dart

import 'package:fcs/domain/entities/shipment.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import '../main/util.dart';
import 'shipment_info.dart';
class ShipmentListRow extends StatelessWidget {
final Shipment pickUp;
final bool isCustomer;
const ShipmentListRow({Key key, this.pickUp, this.isCustomer})
: super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => ShipmentInfo(
shipment: pickUp,
isCustomer: isCustomer,
)));
},
child: Container(
padding: EdgeInsets.only(left: 15, right: 15),
child: Row(
children: <Widget>[
Expanded(
child: new Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: new Row(
children: <Widget>[
Padding(
padding: EdgeInsets.all(5.0),
child: Icon(
SimpleLineIcons.direction,
color: primaryColor,
)),
new Expanded(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: new Text(
pickUp.shipmentNumber,
style: new TextStyle(
fontSize: 15.0, color: Colors.black),
),
),
Padding(
padding: const EdgeInsets.only(left: 10.0, top: 3),
child: new Text(
pickUp.id == null
? ''
: "Last ${pickUp.last} days",
style: new TextStyle(
fontSize: 15.0, color: Colors.grey),
),
)
],
),
),
],
),
),
),
Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(0),
child: getStatus(pickUp.status),
),
// 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),
// ),
// ],
// ),
// ),
],
)
],
),
),
);
}
}