add rate service

This commit is contained in:
Sai Naw Wun
2020-10-15 03:06:13 +06:30
parent 7b88658893
commit 47c07a6c88
45 changed files with 870 additions and 496 deletions

View File

@@ -0,0 +1,54 @@
import 'cargo_type.dart';
class Shipment {
String id;
String userName;
String phoneNumber;
String fromTime;
String toTime;
int numberOfPackage;
int weight;
int handlingFee;
String address;
String status;
DateTime date;
List<CargoType> cargoTypes;
bool isCourier;
int radioIndex;
Shipment(
{this.id,
this.userName,
this.phoneNumber,
this.fromTime,
this.toTime,
this.numberOfPackage,
this.weight,
this.handlingFee,
this.address,
this.status,
this.date,
this.cargoTypes,
this.isCourier = false,
this.radioIndex = 1});
int get last => DateTime.now().difference(date).inDays;
factory Shipment.fromMap(Map<String, dynamic> map, String id) {
return Shipment(
id: id,
userName: map['user_name'],
phoneNumber: map['phone_number'],
fromTime: map['from_time'],
toTime: map['to_time'],
numberOfPackage: map['number_of_package'],
weight: map['weight'],
address: map['address'],
status: map['status']);
}
@override
String toString() {
return 'PickUp{id:$id, userName:$userName,phoneNumber:$phoneNumber,fromTime:$fromTime,toTime:$toTime,numberOfPackage:$numberOfPackage,weight:$weight,status:$status}';
}
}