This commit is contained in:
Phaung Phaung
2021-09-10 12:02:08 +06:30
parent a144c945b6
commit c06ae00b68
35 changed files with 190 additions and 223 deletions

View File

@@ -3,14 +3,13 @@ import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:intl/intl.dart';
import 'delivery_info.dart';
class DeliveryListRow extends StatelessWidget {
final Carton box;
DeliveryListRow({Key key, this.box}) : super(key: key);
final Carton? box;
DeliveryListRow({Key? key, this.box}) : super(key: key);
final double dotSize = 15.0;
final DateFormat dateFormat = new DateFormat("dd MMM yyyy");
@@ -19,10 +18,11 @@ class DeliveryListRow extends StatelessWidget {
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(builder: (context) => DeliveryInfo(box: box)),
);
if (box != null)
Navigator.push(
context,
CupertinoPageRoute(builder: (context) => DeliveryInfo(box: box!)),
);
},
child: Container(
padding: EdgeInsets.only(left: 15, right: 15),
@@ -48,7 +48,7 @@ class DeliveryListRow extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: new Text(
box.cartonNumber ?? "",
box?.cartonNumber ?? "",
style: new TextStyle(
fontSize: 15.0, color: Colors.black),
),
@@ -56,7 +56,7 @@ class DeliveryListRow extends StatelessWidget {
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),
),
@@ -72,14 +72,14 @@ class DeliveryListRow extends StatelessWidget {
children: <Widget>[
Padding(
padding: const EdgeInsets.all(0),
child: getStatus(box.status == null ? "" : box.status),
child: getStatus(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),
),