This commit is contained in:
Sai Naw Wun
2020-06-04 01:36:49 +06:30
parent c84e1beb9d
commit 752e38edf2
17 changed files with 1114 additions and 255 deletions

61
lib/vo/box.dart Normal file
View File

@@ -0,0 +1,61 @@
import 'package.dart';
class Status {
String status;
DateTime date;
bool done;
Status({this.status, this.date, this.done});
}
class Box {
String id;
String shipmentNumber;
String senderFCSID;
String senderName;
String receiverFCSID;
String receiverName;
String receiverAddress;
String receiverNumber;
String boxNumber;
String status;
String cargoDesc;
int rate;
int weight;
String packageType;
String pickUpID;
List<String> photos;
String remark;
DateTime arrivedDate;
List<Package> packages;
int get amount => rate != null && weight != null ? rate * weight : 0;
String get packageNumber =>
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
double get price => rate.toDouble() * weight;
List<Status> statusHistory;
Box(
{this.id,
this.shipmentNumber,
this.senderFCSID,
this.senderName,
this.receiverFCSID,
this.receiverName,
this.receiverNumber,
this.receiverAddress,
this.boxNumber,
this.rate,
this.weight,
this.packageType,
this.pickUpID,
this.remark,
this.status,
this.arrivedDate,
this.cargoDesc,
this.statusHistory,
this.packages});
}

View File

@@ -1,9 +1,9 @@
class Status {
String status;
DateTime date;
bool done;
Status({this.status, this.date, this.done});
}
// class Status {
// String status;
// DateTime date;
// bool done;
// Status({this.status, this.date, this.done});
// }
class Package {
String id;
@@ -17,6 +17,8 @@ class Package {
String boxNumber;
String status;
String cargoDesc;
String market;
String trackingID;
int rate;
int weight;
@@ -32,7 +34,7 @@ class Package {
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
double get price => rate.toDouble() * weight;
List<Status> statusHistory;
// List<Status> statusHistory;
Package(
{this.id,
@@ -52,5 +54,8 @@ class Package {
this.status,
this.arrivedDate,
this.cargoDesc,
this.statusHistory});
this.market,
this.trackingID
// this.statusHistory
});
}