update shipment rate

This commit is contained in:
Thinzar Win
2020-06-25 16:19:23 +06:30
parent fd63f30cb4
commit 869142ec66
18 changed files with 797 additions and 300 deletions

View File

@@ -1,3 +1,4 @@
import 'package:fcs/vo/cargo.dart';
import 'package.dart';
class Status {
@@ -19,6 +20,9 @@ class Box {
String boxNumber;
String status;
String cargoDesc;
int width;
int height;
int length;
int rate;
int weight;
@@ -30,6 +34,8 @@ class Box {
List<Package> packages;
List<Cargo> cargoTypes;
int get amount => rate != null && weight != null ? rate * weight : 0;
String get packageNumber =>
@@ -48,6 +54,9 @@ class Box {
this.receiverNumber,
this.receiverAddress,
this.boxNumber,
this.width,
this.height,
this.length,
this.rate,
this.weight,
this.packageType,
@@ -57,5 +66,6 @@ class Box {
this.arrivedDate,
this.cargoDesc,
this.statusHistory,
this.packages});
this.packages,
this.cargoTypes});
}

6
lib/vo/cargo.dart Normal file
View File

@@ -0,0 +1,6 @@
class Cargo {
String type;
int price;
int weight;
Cargo({this.type, this.price, this.weight});
}

View File

@@ -1,3 +1,5 @@
import 'cargo.dart';
class PickUp {
String id;
String userName;
@@ -10,6 +12,7 @@ class PickUp {
String address;
String status;
DateTime date;
List<Cargo> cargoTypes;
PickUp(
{this.id,
@@ -22,7 +25,8 @@ class PickUp {
this.handlingFee,
this.address,
this.status,
this.date});
this.date,
this.cargoTypes});
int get last => DateTime.now().difference(date).inDays;