getProductAttributeTermById method

Future<WooProductAttributeTerm> getProductAttributeTermById({
  1. required int attributeId,
  2. dynamic termId,
})

Returns a WooProductAttributeTerm, with the specified attributeId and termId.

Implementation

Future<WooProductAttributeTerm> getProductAttributeTermById(
    {required int attributeId, termId}) async {
  WooProductAttributeTerm productAttributeTerm;
  _setApiResourceUrl(
    path: 'products/attributes/' +
        attributeId.toString() +
        '/terms/' +
        termId.toString(),
  );
  final response = await get(queryUri.toString());
  _printToLog('response gotten : ' + response.toString());

  productAttributeTerm = WooProductAttributeTerm.fromJson(response);
  return productAttributeTerm;
}