insert shipment form
This commit is contained in:
97
lib/pages/shipment_list_row.dart
Normal file
97
lib/pages/shipment_list_row.dart
Normal file
@@ -0,0 +1,97 @@
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/vo/shipment.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.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => 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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user