getPairsWellWith method
Gets the Pairs Well With for productId.
Implementation
Future<PrintifyGetPairedProducts> getPairsWellWith({
required String baseUrl,
required String productId,
}) async {
Response? response;
try {
final dio = Dio(
BaseOptions(
contentType: 'application/json',
responseType: ResponseType.json,
baseUrl: 'https://$baseUrl/app',
),
);
response = await dio.get(
'/getPairsWellWithProducts',
queryParameters: {
'productId': productId,
},
);
if (response.statusCode == 200) {
return PrintifyGetPairedProducts.fromJson(response.data);
} else {
throw Exception(
'Non 200 code for getting pairs well with products for product ID $productId. Response: ${response.statusCode}');
}
} catch (e) {
throw Exception(
'Non 200 code for getting pairs well with products for product ID $productId. Response: ${response?.statusCode}');
}
}