From cc88f0f81e85e53befef061e82ebac0825530e16 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 3 Oct 2021 15:59:30 +0300 Subject: [PATCH 1/4] first step of fixing --- .../parmacyModule/parmacy_module_service.dart | 4 ++-- .../service/pharmacy_categorise_service.dart | 5 ++++- lib/pages/final_products_page.dart | 4 +++- .../screens/pharmacy_module_page.dart | 3 ++- .../pharmacies/widgets/manufacturerItem.dart | 18 +++++++++++------- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 72bc56c7..d982c519 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -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; diff --git a/lib/core/service/pharmacy_categorise_service.dart b/lib/core/service/pharmacy_categorise_service.dart index c13f0548..e3ae4c81 100644 --- a/lib/core/service/pharmacy_categorise_service.dart +++ b/lib/core/service/pharmacy_categorise_service.dart @@ -329,6 +329,7 @@ class PharmacyCategoriseService extends BaseService { } Future getMostViewedProducts() async { + hasError = false; Map 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; + hasError = true; + super.error = error.toString(); + // throw error; } } diff --git a/lib/pages/final_products_page.dart b/lib/pages/final_products_page.dart index 843d1d56..78ed3383 100644 --- a/lib/pages/final_products_page.dart +++ b/lib/pages/final_products_page.dart @@ -49,6 +49,8 @@ class _FinalProductsPageState extends State { Widget build(BuildContext context) { return BaseView( 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 { isBottomBar: false, isShowAppBar: true, backgroundColor: Colors.white, - isShowDecPage: false, + isShowDecPage: true, baseViewModel: model, body: Container( height: MediaQuery.of(context).size.height * 5.87, diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index 9b91b77a..d21ee444 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -662,7 +662,8 @@ class _PharmacyPageState extends State { FadePage( page: FinalProductsPage( id: "", - productType: 4, + //TODO Elham* handel this to understans form where the number comming + productType: 20, ), ), ), diff --git a/lib/pages/pharmacies/widgets/manufacturerItem.dart b/lib/pages/pharmacies/widgets/manufacturerItem.dart index 574c37c5..a424512b 100644 --- a/lib/pages/pharmacies/widgets/manufacturerItem.dart +++ b/lib/pages/pharmacies/widgets/manufacturerItem.dart @@ -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( + padding: EdgeInsets.symmetric(horizontal: 8), + child: Image.network( + item.image.src, + fit: BoxFit.cover, + ), + ), ), ), ); From 9b42d411ca5ed784245c425e7e980eb10520314c Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 4 Oct 2021 09:47:48 +0300 Subject: [PATCH 2/4] remove cart from product details --- lib/pages/pharmacies/product_detail.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/pharmacies/product_detail.dart b/lib/pages/pharmacies/product_detail.dart index 28afa2f4..06cae695 100644 --- a/lib/pages/pharmacies/product_detail.dart +++ b/lib/pages/pharmacies/product_detail.dart @@ -93,12 +93,10 @@ class __ProductDetailPageState extends State { if (customerId != null) { itemID = widget.product.id; checkWishlist(); -// getSpecificationData(itemID); } print("customerId:$customerId"); setState(() {}); -// getSpecificationData(itemID); } Widget build(BuildContext context) { @@ -943,6 +941,8 @@ class __ProductDetailPageState extends State { isShowAppBar: true, isPharmacy: true, isShowDecPage: false, + showPharmacyCart: false, + showHomeAppBarIcon: false, body: SingleChildScrollView( child: Column( children: [ From a6a7ed4e1b8429762a89ee799ef151a9da442085 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 4 Oct 2021 09:48:11 +0300 Subject: [PATCH 3/4] remove cart from product details --- lib/widgets/others/app_scafold_detail_page.dart | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/widgets/others/app_scafold_detail_page.dart b/lib/widgets/others/app_scafold_detail_page.dart index 9960b1d1..b7f98b08 100644 --- a/lib/widgets/others/app_scafold_detail_page.dart +++ b/lib/widgets/others/app_scafold_detail_page.dart @@ -183,20 +183,6 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { ), centerTitle: true, actions: [ - isPharmacy - ? IconButton( - icon: Icon(Icons.shopping_cart), - color: Colors.grey, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CartOrderPage()), - ); -// Navigator.of(context) -// .popUntil(ModalRoute.withName('/')); - }) - : Container(), image != null ? InkWell( onTap: () => Navigator.push( From db277a62f549d33d7b69c1857d3371ad086cf584 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 4 Oct 2021 10:24:35 +0300 Subject: [PATCH 4/4] fix brand design --- .../screens/pharmacy_module_page.dart | 2 +- .../pharmacies/widgets/manufacturerItem.dart | 42 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index d21ee444..e5e9e230 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -590,7 +590,7 @@ class _PharmacyPageState extends State { ), ), Container( - height: 60, + height: 100, child: ListView.builder( itemBuilder: (ctx, i) => ManufacturerItem(model.manufacturerList[i]), diff --git a/lib/pages/pharmacies/widgets/manufacturerItem.dart b/lib/pages/pharmacies/widgets/manufacturerItem.dart index a424512b..df5fb166 100644 --- a/lib/pages/pharmacies/widgets/manufacturerItem.dart +++ b/lib/pages/pharmacies/widgets/manufacturerItem.dart @@ -24,31 +24,31 @@ class ManufacturerItem extends StatelessWidget { ), ); }, - child: Card( - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + child: Container( margin: EdgeInsets.symmetric( - horizontal: 8, + horizontal: 12, vertical: 4, ), - child: Container( - decoration: BoxDecoration( - border: Border( - right: BorderSide(color: Colors.grey.shade300, width: 1), - bottom: BorderSide(color: Colors.grey.shade300, width: 1), - left: BorderSide(color: Colors.grey.shade300, width: 1), - top: BorderSide(color: Colors.grey.shade300, width: 1)), - ), - ///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( - padding: EdgeInsets.symmetric(horizontal: 8), - child: Image.network( - item.image.src, - fit: BoxFit.cover, - ), - ), + decoration: BoxDecoration( + borderRadius:BorderRadius.circular(12) , + border: Border( + right: BorderSide(color: Colors.grey.shade300, width: 1), + bottom: BorderSide(color: Colors.grey.shade300, width: 1), + left: BorderSide(color: Colors.grey.shade300, width: 1), + top: BorderSide(color: Colors.grey.shade300, width: 1)), ), + child: item.image == null + ? Padding( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10), + child: AppText(item.name, fontWeight: FontWeight.w500,fontSize: 14,), + ) + : Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: Image.network( + item.image.src, + fit: BoxFit.cover, + ), + ), ), ); }