add mix carton
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:fcs/domain/entities/cargo_type.dart';
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/domain/vo/delivery_address.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/carton/widgets.dart';
|
||||
import 'package:fcs/pages/delivery/model/delivery_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
@@ -460,90 +461,80 @@ class _DeliveryInfoState extends State<DeliveryInfo> {
|
||||
// ),
|
||||
// ],
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(children: <Widget>[
|
||||
// Center(child: nameWidget(_box.packageNumber)),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
LocalTitle(textKey: "box.type.title"),
|
||||
cargoType,
|
||||
LocalTitle(textKey: "box.shipment_info"),
|
||||
shipmentBox,
|
||||
fcsIDBox,
|
||||
customerNameBox,
|
||||
_selectedCartonType == "From packages"
|
||||
? Column(
|
||||
children: [
|
||||
LocalTitle(textKey: "box.packages"),
|
||||
packageTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Column(
|
||||
children: getPackageRowList(),
|
||||
),
|
||||
],
|
||||
)
|
||||
: _selectedCartonType == "From shipments"
|
||||
? Column(
|
||||
children: [
|
||||
LocalTitle(textKey: "box.shipment.boxes"),
|
||||
shipmentBoxTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
shipmentBoxRow
|
||||
],
|
||||
)
|
||||
: _selectedCartonType == "Mix carton"
|
||||
? Column(
|
||||
children: [
|
||||
LocalTitle(textKey: "box.shipment.boxes"),
|
||||
mixBoxTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Column(
|
||||
children: getMixBoxRowList(),
|
||||
)
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
LocalTitle(textKey: "box.cargo_type"),
|
||||
cargoTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Column(
|
||||
children: getCargoRowList(),
|
||||
),
|
||||
LocalTitle(textKey: "box.dimension"),
|
||||
dimBox,
|
||||
shipmentWeightBox,
|
||||
LocalTitle(textKey: "box.delivery_address"),
|
||||
DefaultDeliveryAddress(
|
||||
deliveryAddress: _deliveryAddress,
|
||||
labelKey: "box.delivery_address",
|
||||
),
|
||||
LocalTitle(textKey: "box.status"),
|
||||
Container(
|
||||
height: 230,
|
||||
child: Timeline(
|
||||
children: _models(), position: TimelinePosition.Left),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(children: <Widget>[
|
||||
Center(child: getCartonNumberStatus(context, _box)),
|
||||
LocalTitle(textKey: "box.type.title"),
|
||||
cargoType,
|
||||
LocalTitle(textKey: "box.shipment_info"),
|
||||
shipmentBox,
|
||||
fcsIDBox,
|
||||
customerNameBox,
|
||||
_selectedCartonType == "From packages"
|
||||
? Column(
|
||||
children: [
|
||||
LocalTitle(textKey: "box.packages"),
|
||||
packageTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Column(
|
||||
children: getPackageRowList(),
|
||||
),
|
||||
],
|
||||
)
|
||||
]),
|
||||
)),
|
||||
],
|
||||
),
|
||||
: _selectedCartonType == "From shipments"
|
||||
? Column(
|
||||
children: [
|
||||
LocalTitle(textKey: "box.shipment.boxes"),
|
||||
shipmentBoxTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
shipmentBoxRow
|
||||
],
|
||||
)
|
||||
: _selectedCartonType == "Mix carton"
|
||||
? Column(
|
||||
children: [
|
||||
LocalTitle(textKey: "box.shipment.boxes"),
|
||||
mixBoxTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Column(
|
||||
children: getMixBoxRowList(),
|
||||
)
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
LocalTitle(textKey: "box.cargo_type"),
|
||||
cargoTitle,
|
||||
Divider(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
Column(
|
||||
children: getCargoRowList(),
|
||||
),
|
||||
LocalTitle(textKey: "box.dimension"),
|
||||
dimBox,
|
||||
shipmentWeightBox,
|
||||
LocalTitle(textKey: "box.delivery_address"),
|
||||
DefaultDeliveryAddress(
|
||||
deliveryAddress: _deliveryAddress,
|
||||
labelKey: "box.delivery_address",
|
||||
),
|
||||
LocalTitle(textKey: "box.status"),
|
||||
Container(
|
||||
height: 230,
|
||||
child: Timeline(
|
||||
children: _models(), position: TimelinePosition.Left),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -8,32 +8,20 @@ import 'package:intl/intl.dart';
|
||||
|
||||
import 'delivery_info.dart';
|
||||
|
||||
class DeliveryListRow extends StatefulWidget {
|
||||
class DeliveryListRow extends StatelessWidget {
|
||||
final Carton box;
|
||||
const DeliveryListRow({Key key,this.box}):super(key:key);
|
||||
DeliveryListRow({Key key, this.box}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DeliveryListRowState createState() => _DeliveryListRowState();
|
||||
}
|
||||
|
||||
class _DeliveryListRowState extends State<DeliveryListRow> {
|
||||
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) => DeliveryInfo(box: _box)),
|
||||
CupertinoPageRoute(builder: (context) => DeliveryInfo(box: box)),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
@@ -42,7 +30,7 @@ class _DeliveryListRowState extends State<DeliveryListRow> {
|
||||
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>[
|
||||
Container(
|
||||
@@ -60,7 +48,7 @@ class _DeliveryListRowState extends State<DeliveryListRow> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
_box.cartonNumber ?? "",
|
||||
box.cartonNumber ?? "",
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
@@ -68,7 +56,7 @@ class _DeliveryListRowState extends State<DeliveryListRow> {
|
||||
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),
|
||||
),
|
||||
@@ -84,14 +72,14 @@ class _DeliveryListRowState extends State<DeliveryListRow> {
|
||||
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