getProductVariationById method

Future<WooProductVariation> getProductVariationById({
  1. required int productId,
  2. dynamic variationId,
})

Returns a WooProductVariation, with the specified productId and variationId.

Implementation

Future<WooProductVariation> getProductVariationById(
    {required int productId, variationId}) async {
  WooProductVariation productVariation;
  _setApiResourceUrl(
    path: 'products/' +
        productId.toString() +
        '/variations/' +
        variationId.toString(),
  );
  final response = await get(queryUri.toString());
  _printToLog('response gotten : ' + response.toString());

  productVariation = WooProductVariation.fromJson(response);
  return productVariation;
}