Files
fcs/lib/vo/pickup.dart

45 lines
1.1 KiB
Dart
Raw Normal View History

2020-05-29 15:54:26 +06:30
class PickUp {
String id;
String userName;
String phoneNumber;
String fromTime;
String toTime;
int numberOfPackage;
int weight;
String address;
String status;
2020-05-31 15:00:11 +06:30
DateTime date;
2020-05-29 15:54:26 +06:30
PickUp(
{this.id,
this.userName,
this.phoneNumber,
this.fromTime,
this.toTime,
this.numberOfPackage,
this.weight,
this.address,
2020-05-31 15:00:11 +06:30
this.status,
this.date});
int get last => DateTime.now().difference(date).inDays;
2020-05-29 15:54:26 +06:30
factory PickUp.fromMap(Map<String, dynamic> map, String id) {
return PickUp(
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}';
}
}