getOrderById method

Future<WooOrder> getOrderById(
  1. int id, {
  2. String? dp,
})

Returns a WooOrder object that matches the provided id.

Implementation

Future<WooOrder> getOrderById(int id, {String? dp}) async {
  Map<String, dynamic> payload = {};
  if (dp != null) payload["dp"] = dp;
  _setApiResourceUrl(
      path: 'orders/' + id.toString(), queryParameters: payload);
  final response = await get(queryUri.toString());
  return WooOrder.fromJson(response);
}