diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ac7d002d..713b009f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -557,6 +557,7 @@ const Map localizedValues = { "itemsNo": {"en": "items(s)", "ar": "عناصر"}, "noOrder": {"en": "You Don't have any orders.", "ar": "ليس لديك طلبات"}, "noResult": {"en": "No Result.", "ar": "لايوجد نتئج"}, + "nonRecommended": {"en": "No Recommended Products.", "ar": "لا يوجد منتجات"}, "TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"}, "Beforeusing": {"en": "Before using the checkup, please read Terms of Service.", "ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة"}, diff --git a/lib/core/model/pharmacies/recommendedProduct_model.dart b/lib/core/model/pharmacies/recommendedProduct_model.dart index ce0d17ee..7608aca4 100644 --- a/lib/core/model/pharmacies/recommendedProduct_model.dart +++ b/lib/core/model/pharmacies/recommendedProduct_model.dart @@ -18,7 +18,7 @@ class RecommendedProductModel { int notApprovedRatingSum; int approvedTotalReviews; int notApprovedTotalReviews; - String sku; + dynamic sku; bool isRx; bool prescriptionRequired; // dynamic rxMessage; diff --git a/lib/pages/pharmacies/product_detail.dart b/lib/pages/pharmacies/product_detail.dart index 87c986c0..b1ec665a 100644 --- a/lib/pages/pharmacies/product_detail.dart +++ b/lib/pages/pharmacies/product_detail.dart @@ -665,7 +665,8 @@ class __ProductDetailPageState extends State { itemCount: model.recommendedProductList.length, itemBuilder: (context, index) { return InkWell( - onTap: () { + onTap: () + { Navigator.push( context, FadePage( @@ -911,7 +912,15 @@ class __ProductDetailPageState extends State { }), ) : Container( - child: Text("There is no product"), + // color: Colors.white, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts(TranslationBase.of(context).nonRecommended, + color: Colors.black,), + ], + ), ), )), ), diff --git a/lib/pages/pharmacies/screens/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-order-page.dart index f672cc66..5271eda1 100644 --- a/lib/pages/pharmacies/screens/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-order-page.dart @@ -22,12 +22,16 @@ class CartOrderPage extends StatelessWidget { final mediaQuery = MediaQuery.of(context); final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; - + AppScaffold appScaffold; return BaseView( - onModelReady: (model) => model.getOrderPreviewData(), + onModelReady: (model){ + model.getShoppingCart().then((value){ + appScaffold.appBar.badgeUpdater('${model.cartResponse.itemCount ?? 0}'); + }); + }, builder: (_, model, wi) => ChangeNotifierProvider.value( value: model.cartResponse, - child: AppScaffold( + child: appScaffold = AppScaffold( appBarTitle: TranslationBase.of(context).shoppingCart, isShowAppBar: true, isPharmacy: true, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index c672e86c..c42003cb 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1069,12 +1069,14 @@ class TranslationBase { String get consumed => localizedValues['consumed'][locale.languageCode]; String get transferred => localizedValues['transferred'][locale.languageCode]; - - String get checkBeneficiary => localizedValues['checkBeneficiary'][locale.languageCode]; - - String get beneficiaryName => localizedValues['beneficiaryName'][locale.languageCode]; - - String get accountActivation => localizedValues['accountActivation'][locale.languageCode]; + String get checkBeneficiary => + localizedValues['checkBeneficiary'][locale.languageCode]; + String get beneficiaryName => + localizedValues['beneficiaryName'][locale.languageCode]; + String get accountActivation => + localizedValues['accountActivation'][locale.languageCode]; + String get nonRecommended => + localizedValues['nonRecommended'][locale.languageCode]; String get lakumTransfer => localizedValues['lakumTransfer'][locale.languageCode]; diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 91f246ea..911025b5 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -274,6 +274,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { Size get preferredSize => Size(double.maxFinite, 60); } +String _badgeText = "0"; class AppBarWidgetState extends State { String badgeText = "0"; @override @@ -284,7 +285,7 @@ class AppBarWidgetState extends State { badgeUpdateBlock(String value) { setState(() { - badgeText = value; + _badgeText = value; }); } @@ -307,7 +308,7 @@ class AppBarWidgetState extends State { actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge(badgeContent: Text(badgeText), child: Icon(Icons.shopping_cart)), + icon: Badge(badgeContent: Text(_badgeText), child: Icon(Icons.shopping_cart)), color: Colors.white, onPressed: () { Navigator.of(context).popUntil(ModalRoute.withName('/')); @@ -318,7 +319,7 @@ class AppBarWidgetState extends State { icon: Badge( position: BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( - badgeText, + _badgeText, style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), ), child: Icon(Icons.shopping_cart)), diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index ee6c1d81..76e46949 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:rating_bar/rating_bar.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; class productTile extends StatelessWidget { final String productName; @@ -135,8 +136,10 @@ class productTile extends StatelessWidget { children: [ IconButton( icon: Icon(FontAwesomeIcons.trashAlt, size: 15), - onPressed: () { - deleteFromWishlistFunction(productID); + onPressed: (){ + GifLoaderDialogUtils.showMyDialog(context); + deleteFromWishlistFunction(productID); + GifLoaderDialogUtils.hideDialog(context); }, ), SizedBox( @@ -145,11 +148,14 @@ class productTile extends StatelessWidget { IconButton( icon: Icon(FontAwesomeIcons.shoppingCart, size: 15), onPressed: () async { + GifLoaderDialogUtils.showMyDialog(context); await addToCartFunction(1, productID); + GifLoaderDialogUtils.hideDialog(context); Navigator.push( context, FadePage(page: CartOrderPage()), ); + }, ), ],