2020-10-15 03:06:13 +06:30
|
|
|
import 'cargo_type.dart';
|
2020-06-25 16:19:23 +06:30
|
|
|
|
2020-10-07 14:42:07 +06:30
|
|
|
class Shipment {
|
2020-05-29 15:54:26 +06:30
|
|
|
String id;
|
|
|
|
|
String userName;
|
|
|
|
|
String phoneNumber;
|
|
|
|
|
String fromTime;
|
|
|
|
|
String toTime;
|
|
|
|
|
int numberOfPackage;
|
|
|
|
|
int weight;
|
2020-06-24 16:06:40 +06:30
|
|
|
int handlingFee;
|
2020-05-29 15:54:26 +06:30
|
|
|
String address;
|
|
|
|
|
String status;
|
2020-05-31 15:00:11 +06:30
|
|
|
DateTime date;
|
2020-10-15 03:06:13 +06:30
|
|
|
List<CargoType> cargoTypes;
|
2020-06-30 16:27:56 +06:30
|
|
|
bool isCourier;
|
2020-07-01 08:12:59 +06:30
|
|
|
int radioIndex;
|
2020-05-29 15:54:26 +06:30
|
|
|
|
2020-10-07 14:42:07 +06:30
|
|
|
Shipment(
|
2020-05-29 15:54:26 +06:30
|
|
|
{this.id,
|
|
|
|
|
this.userName,
|
|
|
|
|
this.phoneNumber,
|
|
|
|
|
this.fromTime,
|
|
|
|
|
this.toTime,
|
|
|
|
|
this.numberOfPackage,
|
|
|
|
|
this.weight,
|
2020-06-24 16:06:40 +06:30
|
|
|
this.handlingFee,
|
2020-05-29 15:54:26 +06:30
|
|
|
this.address,
|
2020-05-31 15:00:11 +06:30
|
|
|
this.status,
|
2020-06-25 16:19:23 +06:30
|
|
|
this.date,
|
2020-06-30 16:27:56 +06:30
|
|
|
this.cargoTypes,
|
2020-07-01 08:12:59 +06:30
|
|
|
this.isCourier = false,
|
|
|
|
|
this.radioIndex = 1});
|
2020-05-31 15:00:11 +06:30
|
|
|
|
|
|
|
|
int get last => DateTime.now().difference(date).inDays;
|
2020-05-29 15:54:26 +06:30
|
|
|
|
2020-10-07 14:42:07 +06:30
|
|
|
factory Shipment.fromMap(Map<String, dynamic> map, String id) {
|
|
|
|
|
return Shipment(
|
2020-05-29 15:54:26 +06:30
|
|
|
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}';
|
|
|
|
|
}
|
|
|
|
|
}
|