DeliveryRequest.fromMap constructor
DeliveryRequest.fromMap(
- Map map
Implementation
factory DeliveryRequest.fromMap(Map<dynamic, dynamic> map) {
return DeliveryRequest(
id: map['id'] as int,
user_id: map['user_id'] as int,
payment_request_id: map['payment_request_id'] as int,
status_id: map['status_id'] as int,
pickup_address_id: map['pickup_address_id'] as int,
delivery_address_id: map['delivery_address_id'] as int,
pickup_time: map['pickup_time'] .toString(),
estimated_distance: map['estimated_distance'] as double,
actual_distance: map['actual_distance'] as int,
estimated_duration: map['estimated_duration'] .toString(),
delivery_cost: map['delivery_cost'] as int,
recipient_name: map['recipient_name'] .toString(),
recipient_mobile: map['recipient_mobile'] .toString(),
item_type: map['item_type'] .toString(),
note: map['note'] .toString(),
instructions: map['instructions'] .toString(),
created_at: map['created_at'] .toString(),
updated_at: map['updated_at'] .toString(),
deleted_at: map['deleted_at'] .toString(),
status: Status.fromMap(map['status'] as Map<dynamic, dynamic>),
user: User.fromMap(map['user'] as Map<dynamic, dynamic>),
pickupAddress:
PickupAddress.fromMap(map['pickup_address'] as Map<dynamic, dynamic>),
deliveryAddress: DeliveryAddress.fromMap(
map['delivery_address'] as Map<dynamic, dynamic>),
paymentRequest: PaymentRequest.fromMap(
map['payment_request'] as Map<dynamic, dynamic>),
);
}