getDeliveryRequest method
Implementation
Future<DeliveryRequest> getDeliveryRequest(int id) async {
final result = await http.get(
Uri.parse("$getDeliveryRequestURL/$id/?with[]=payment_request.payment_method&with[]=pickup_address&with[]=delivery_address&with[]=status&with[]=user"),
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"api-key": apikey,
},
);
var convertDataToJson = jsonDecode(result.body);
if (kDebugMode) {
print("RES=========$convertDataToJson");
}
return DeliveryRequest.fromMap(convertDataToJson);
}