@ -121,9 +121,9 @@ class PharmacyModuleService extends BaseService {
manufacturerList.clear();
response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item);
if (manufacturer.image != null) {
// if (manufacturer.image != null) {
manufacturerList.add(Manufacturer.fromJson(item));
}
// }
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -329,6 +329,7 @@ class PharmacyCategoriseService extends BaseService {
Future getMostViewedProducts() async {
hasError = false;
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',
@ -346,7 +347,9 @@ class PharmacyCategoriseService extends BaseService {
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
super.error = error.toString();
// throw error;
@ -49,6 +49,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Widget build(BuildContext context) {
return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) {
//TODO Elham* fix all services in order handel errors in better way in the service
if (widget.productType == 1) {
model.getFinalProducts(i: id);
} else if (widget.productType == 2) {
@ -71,7 +73,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
isBottomBar: false,
isShowAppBar: true,
backgroundColor: Colors.white,
isShowDecPage: false,
isShowDecPage: true,
baseViewModel: model,
body: Container(
height: MediaQuery.of(context).size.height * 5.87,
@ -662,7 +662,8 @@ class _PharmacyPageState extends State<PharmacyPage> {
FadePage(
page: FinalProductsPage(
id: "",
productType: 4,
//TODO Elham* handel this to understans form where the number comming
productType: 20,
),
@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -37,13 +38,16 @@ class ManufacturerItem extends StatelessWidget {
left: BorderSide(color: Colors.grey.shade300, width: 1),
top: BorderSide(color: Colors.grey.shade300, width: 1)),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Image.network(
item.image.src,
fit: BoxFit.cover,
///TODO Elham* Improve design and check if they show the image and name or just name
child: item.image == null
? Container(child: AppText(item.name))
: Padding(
);