Files
fcs/lib/pages/invoice/invoice_shipment_list_row.dart

97 lines
3.2 KiB
Dart
Raw Normal View History

2020-10-16 21:38:39 +06:30
import 'package:fcs/domain/entities/fcs_shipment.dart';
2020-10-14 20:56:46 +06:30
import 'package:fcs/helpers/theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
2020-10-16 21:38:39 +06:30
import 'package:intl/intl.dart';
2020-10-14 20:56:46 +06:30
import '../main/util.dart';
import 'invoice_customer_list.dart';
class InvoiceShipmentListRow extends StatefulWidget {
2020-10-16 21:38:39 +06:30
final FcsShipment fcsShipment;
const InvoiceShipmentListRow({this.fcsShipment});
2020-10-14 20:56:46 +06:30
@override
_InvoiceShipmentListRowState createState() => _InvoiceShipmentListRowState();
}
class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
final double dotSize = 15.0;
2020-10-16 21:38:39 +06:30
final dateFormatter = new DateFormat('dd MMM yyyy');
FcsShipment _fcsShipment = new FcsShipment();
2020-10-14 20:56:46 +06:30
@override
void initState() {
super.initState();
2020-10-16 21:38:39 +06:30
if (widget.fcsShipment != null) {
_fcsShipment = widget.fcsShipment;
2020-10-14 20:56:46 +06:30
}
}
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 15, right: 15),
child: InkWell(
onTap: () {
2020-10-22 04:14:53 +06:30
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => InvoiceCustomerList(
fcsShipment: _fcsShipment,
)));
2020-10-14 20:56:46 +06:30
},
child: Row(
children: <Widget>[
Expanded(
child: new Padding(
2020-10-16 21:38:39 +06:30
padding: const EdgeInsets.symmetric(vertical: 10.0),
2020-10-14 20:56:46 +06:30
child: new Row(
children: <Widget>[
2020-10-16 21:38:39 +06:30
Container(
padding: EdgeInsets.only(left: 5, right: 10),
child: Icon(
Ionicons.ios_airplane,
color: primaryColor,
size: 30,
),
),
2020-10-14 20:56:46 +06:30
new Expanded(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: new Text(
2020-10-16 21:38:39 +06:30
_fcsShipment.shipmentNumber == null
? ''
: _fcsShipment.shipmentNumber,
2020-10-14 20:56:46 +06:30
style: new TextStyle(
fontSize: 15.0, color: Colors.black),
),
),
Padding(
padding: const EdgeInsets.only(left: 10.0, top: 10),
child: new Text(
2020-10-16 21:38:39 +06:30
dateFormatter.format(_fcsShipment.cutoffDate),
2020-10-14 20:56:46 +06:30
style: new TextStyle(
fontSize: 15.0, color: Colors.grey),
),
)
],
),
),
],
),
),
),
2020-10-16 21:38:39 +06:30
Padding(
padding: const EdgeInsets.all(0),
child: getStatus(_fcsShipment.status),
),
2020-10-14 20:56:46 +06:30
],
),
),
);
}
}