getProductMaterial method

Future<ProductMaterialResult?> getProductMaterial({
  1. required String productId,
  2. ApiError? error,
})

获取商品的推广素材 商品精推素材 productId 大淘客商品id或者淘宝商品id

Implementation

Future<ProductMaterialResult?> getProductMaterial(
    {required String productId, ApiError? error}) async {
  final url = '/product-material';
  final response = await util.get(url, data: {"id": productId}, error: error);
  return (response.isNotEmpty
      ? (productMaterialResultFromJson(response).isNotEmpty
          ? productMaterialResultFromJson(response)[0]
          : null)
      : []) as FutureOr<ProductMaterialResult?>;
}