96 lines
3.0 KiB
Dart
96 lines
3.0 KiB
Dart
import 'package:fcs/theme/theme.dart';
|
|
import 'package:fcs/vo/shipment.dart';
|
|
import 'package:fcs/widget/bottom_up_page_route.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_icons/flutter_icons.dart';
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'shipment_editor.dart';
|
|
import 'util.dart';
|
|
|
|
class ShipmentListRow extends StatefulWidget {
|
|
final Shipment shipment;
|
|
const ShipmentListRow({this.shipment});
|
|
|
|
@override
|
|
_ShipmentListRowState createState() => _ShipmentListRowState();
|
|
}
|
|
|
|
class _ShipmentListRowState extends State<ShipmentListRow> {
|
|
var dateFormatter = new DateFormat('dd MMM yyyy');
|
|
final double dotSize = 15.0;
|
|
Shipment _shipment = new Shipment();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
|
|
if (widget.shipment != null) {
|
|
_shipment = widget.shipment;
|
|
}
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: EdgeInsets.only(left: 15, right: 15),
|
|
child: InkWell(
|
|
onTap: () {
|
|
Navigator.of(context)
|
|
.push(BottomUpPageRoute(ShipmentEditor(shipment: _shipment)));
|
|
},
|
|
child: Row(
|
|
children: <Widget>[
|
|
Expanded(
|
|
child: new Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
|
child: new Row(
|
|
children: <Widget>[
|
|
Container(
|
|
padding: EdgeInsets.only(left: 5, right: 10),
|
|
child: Icon(
|
|
Ionicons.ios_airplane,
|
|
color: primaryColor,
|
|
size: 30,
|
|
),
|
|
),
|
|
new Expanded(
|
|
child: new Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Padding(
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
child: new Text(
|
|
_shipment.shipmentNumber == null
|
|
? ''
|
|
: _shipment.shipmentNumber,
|
|
style: new TextStyle(
|
|
fontSize: 15.0, color: Colors.black),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
|
child: new Text(
|
|
dateFormatter.format(_shipment.shipDate),
|
|
style: new TextStyle(
|
|
fontSize: 15.0, color: Colors.grey),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(0),
|
|
child: getStatus(_shipment.status),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|