add mix carton
This commit is contained in:
@@ -7,32 +7,20 @@ import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'carton_info.dart';
|
||||
|
||||
class CartonListRow extends StatefulWidget {
|
||||
class CartonListRow extends StatelessWidget {
|
||||
final Carton box;
|
||||
const CartonListRow({Key key, this.box}) : super(key: key);
|
||||
CartonListRow({Key key, this.box}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CartonListRowState createState() => _CartonListRowState();
|
||||
}
|
||||
|
||||
class _CartonListRowState extends State<CartonListRow> {
|
||||
final double dotSize = 15.0;
|
||||
Carton _box = new Carton();
|
||||
final DateFormat dateFormat = new DateFormat("dd MMM yyyy");
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_box = widget.box;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(builder: (context) => CartonInfo(box: _box)),
|
||||
CupertinoPageRoute(builder: (context) => CartonInfo(box: box)),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
@@ -59,7 +47,7 @@ class _CartonListRowState extends State<CartonListRow> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
_box.cartonNumber ?? "",
|
||||
box.cartonNumber ?? "",
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
@@ -67,7 +55,7 @@ class _CartonListRowState extends State<CartonListRow> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
||||
child: new Text(
|
||||
_box.userName ?? "",
|
||||
box.userName ?? "",
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
@@ -83,14 +71,14 @@ class _CartonListRowState extends State<CartonListRow> {
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: getStatus(_box.status == null ? "" : _box.status),
|
||||
child: getStatus(box.status == null ? "" : box.status),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
"${_box.actualWeight?.toString() ?? ''} lb",
|
||||
"${box.actualWeight?.toString() ?? ''} lb",
|
||||
style:
|
||||
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user