Files
fcs/lib/pages_fcs/package_list_row.dart

109 lines
3.6 KiB
Dart
Raw Normal View History

2020-06-01 11:52:12 +06:30
import 'package:fcs/pages/util.dart';
import 'package:fcs/pages_fcs/package_editor.dart';
import 'package:fcs/vo/package.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class PackageListRow extends StatefulWidget {
final Package package;
const PackageListRow({this.package});
@override
_PackageListRowtate createState() => _PackageListRowtate();
}
class _PackageListRowtate extends State<PackageListRow> {
final double dotSize = 15.0;
Package _package = new Package();
final DateFormat dateFormat = new DateFormat("dd MMM yyyy");
@override
void initState() {
super.initState();
_package = widget.package;
}
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 15, right: 15),
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PackageEditor(package: _package)),
);
},
child: Row(
children: <Widget>[
Expanded(
child: new Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: new Row(
children: <Widget>[
new Expanded(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: new Text(
_package.packageNumber == null
? ''
: _package.packageNumber,
style: new TextStyle(
fontSize: 15.0, color: Colors.black),
),
),
Padding(
padding: const EdgeInsets.only(left: 10.0, top: 10),
child: new Text(
dateFormat.format(_package.arrivedDate),
style: new TextStyle(
fontSize: 15.0, color: Colors.grey),
),
)
],
),
),
],
),
),
),
Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(0),
child: getStatus(_package.status),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
child: Row(
children: <Widget>[
new Text(
_package.weight == null
? ''
: _package.weight.toString() + 'lb - ',
style:
new TextStyle(fontSize: 15.0, color: Colors.grey),
),
new Text(
_package.price == null
? ""
: "\$ " + _package.price.toString(),
style:
new TextStyle(fontSize: 15.0, color: Colors.grey),
),
],
),
),
],
)
],
),
),
);
}
}