update invoice
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/domain/entities/fcs_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 'package:intl/intl.dart';
|
||||
|
||||
import '../main/util.dart';
|
||||
import 'invoice_customer_list.dart';
|
||||
|
||||
class InvoiceShipmentListRow extends StatefulWidget {
|
||||
final Shipment pickUp;
|
||||
const InvoiceShipmentListRow({this.pickUp});
|
||||
final FcsShipment fcsShipment;
|
||||
const InvoiceShipmentListRow({this.fcsShipment});
|
||||
|
||||
@override
|
||||
_InvoiceShipmentListRowState createState() => _InvoiceShipmentListRowState();
|
||||
@@ -17,13 +18,14 @@ class InvoiceShipmentListRow extends StatefulWidget {
|
||||
|
||||
class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
|
||||
final double dotSize = 15.0;
|
||||
Shipment _pickUp = new Shipment();
|
||||
final dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
FcsShipment _fcsShipment = new FcsShipment();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.pickUp != null) {
|
||||
_pickUp = widget.pickUp;
|
||||
if (widget.fcsShipment != null) {
|
||||
_fcsShipment = widget.fcsShipment;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,15 +42,17 @@ class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.all(5.0),
|
||||
child: Icon(
|
||||
SimpleLineIcons.direction,
|
||||
color: primaryColor,
|
||||
)),
|
||||
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,
|
||||
@@ -56,7 +60,9 @@ class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
_pickUp.id == null ? '' : _pickUp.id,
|
||||
_fcsShipment.shipmentNumber == null
|
||||
? ''
|
||||
: _fcsShipment.shipmentNumber,
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
@@ -64,9 +70,7 @@ class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
||||
child: new Text(
|
||||
_pickUp.id == null
|
||||
? ''
|
||||
: "Last ${_pickUp.last} days",
|
||||
dateFormatter.format(_fcsShipment.cutoffDate),
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
@@ -78,35 +82,10 @@ class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: getStatus(_pickUp.currentStatus),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
_pickUp.weight == null
|
||||
? ''
|
||||
: _pickUp.weight.toString() + 'lb - ',
|
||||
style:
|
||||
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
new Text(
|
||||
_pickUp.numberOfPackage == null
|
||||
? ""
|
||||
: _pickUp.numberOfPackage.toString() + ' packages',
|
||||
style:
|
||||
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: getStatus(_fcsShipment.status),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user