|
|
|
@ -316,4 +316,50 @@ class PharmacyCategoriseService extends BaseService {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future getMostViewedProducts() async {
|
|
|
|
|
|
|
|
Map<String, String> queryParams = {
|
|
|
|
|
|
|
|
'fields':
|
|
|
|
|
|
|
|
'id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage',
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS,
|
|
|
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
|
|
|
_finalProducts.clear();
|
|
|
|
|
|
|
|
response['products'].forEach((item) {
|
|
|
|
|
|
|
|
_finalProducts.add(PharmacyProduct.fromJson(item));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
print("most viewed products ---------");
|
|
|
|
|
|
|
|
print(response);
|
|
|
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
|
|
|
hasError = true;
|
|
|
|
|
|
|
|
super.error = error;
|
|
|
|
|
|
|
|
}, queryParams: queryParams);
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
throw error;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future getNewProducts() async {
|
|
|
|
|
|
|
|
Map<String, String> queryParams = {
|
|
|
|
|
|
|
|
'fields':
|
|
|
|
|
|
|
|
'Id,name,namen,localized_names,price,images,sku,stock_availability,published',
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await baseAppClient.getPharmacy(GET_NEW_PRODUCTS,
|
|
|
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
|
|
|
_finalProducts.clear();
|
|
|
|
|
|
|
|
response['products'].forEach((item) {
|
|
|
|
|
|
|
|
_finalProducts.add(PharmacyProduct.fromJson(item));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
print("new products ---------");
|
|
|
|
|
|
|
|
print(response);
|
|
|
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
|
|
|
hasError = true;
|
|
|
|
|
|
|
|
super.error = error;
|
|
|
|
|
|
|
|
}, queryParams: queryParams);
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
throw error;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|