diff --git a/assets/images/pharmacy_module/bg_1.png b/assets/images/pharmacy_module/bg_1.png index 9505e556..0155a7b3 100644 Binary files a/assets/images/pharmacy_module/bg_1.png and b/assets/images/pharmacy_module/bg_1.png differ diff --git a/assets/images/pharmacy_module/bg_2.png b/assets/images/pharmacy_module/bg_2.png index 96cfd3bc..0a1bc5cb 100644 Binary files a/assets/images/pharmacy_module/bg_2.png and b/assets/images/pharmacy_module/bg_2.png differ diff --git a/assets/images/pharmacy_module/bg_3.png b/assets/images/pharmacy_module/bg_3.png index 127c2669..3a28d5f9 100644 Binary files a/assets/images/pharmacy_module/bg_3.png and b/assets/images/pharmacy_module/bg_3.png differ diff --git a/assets/images/pharmacy_module/bg_4.png b/assets/images/pharmacy_module/bg_4.png index 423ab421..234ebe7b 100644 Binary files a/assets/images/pharmacy_module/bg_4.png and b/assets/images/pharmacy_module/bg_4.png differ diff --git a/lib/core/model/pharmacies/PharmacyProduct.dart b/lib/core/model/pharmacies/PharmacyProduct.dart index f69d035b..dbef5737 100644 --- a/lib/core/model/pharmacies/PharmacyProduct.dart +++ b/lib/core/model/pharmacies/PharmacyProduct.dart @@ -108,10 +108,10 @@ class PharmacyProduct { List manufacturerIds; List reviews; List images; - List attributes; + List attributes; List specifications; - List associatedProductIds; - List tags; + List associatedProductIds; + List tags; int vendorId; String seName; @@ -367,7 +367,7 @@ class PharmacyProduct { }); } if (json['attributes'] != null) { - attributes = new List(); + attributes = new List(); json['attributes'].forEach((v) { attributes.add(v); }); diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index e74a353b..d5e5a207 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -785,7 +785,8 @@ class BaseAppClient { final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); + var parsed = json.decode(utf8.decode(response.bodyBytes)); + onFailure(parsed['error']['ErrorEndUserMsg'] ??'Error While Fetching data', statusCode); } else { // var parsed = json.decode(response.body.toString()); var parsed = json.decode(utf8.decode(response.bodyBytes)); diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index d982c519..b32b86e0 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -113,7 +113,6 @@ class PharmacyModuleService extends BaseService { } Future getTopManufacturerList() async { - hasError = false; Map queryParams = {'page': '1', 'limit': '8'}; try { await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER, @@ -125,6 +124,7 @@ class PharmacyModuleService extends BaseService { manufacturerList.add(Manufacturer.fromJson(item)); // } }); + hasError = false; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -146,6 +146,7 @@ class PharmacyModuleService extends BaseService { response['products'].forEach((item) { bestSellerProducts.add(PharmacyProduct.fromJson(item)); }); + hasError = false; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -161,6 +162,7 @@ class PharmacyModuleService extends BaseService { null) { lastVisited = await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); + // lastVisited = "2458,4561"; try { await baseAppClient .getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", @@ -169,8 +171,9 @@ class PharmacyModuleService extends BaseService { response['products'].forEach((item) { lastVisitedProducts.add(PharmacyProduct.fromJson(item)); }); + hasError = false; }, onFailure: (String error, int statusCode) { - hasError = true; + hasError = true; // sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, ""); super.error = error; }); } catch (error) { diff --git a/lib/core/viewModels/pharmacyModule/BestSellerViewModel.dart b/lib/core/viewModels/pharmacyModule/BestSellerViewModel.dart index f530999b..b03ee5b9 100644 --- a/lib/core/viewModels/pharmacyModule/BestSellerViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/BestSellerViewModel.dart @@ -13,14 +13,14 @@ class BestSellerViewModel extends BaseViewModel { _pharmacyService.bestSellerProducts; getBestSellerProducts() async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _pharmacyService.getBestSellerProducts(); - if (_pharmacyService.hasError) { - error = _pharmacyService.error; - setState(ViewState.Error); - } else { + // if (_pharmacyService.hasError) { + // error = _pharmacyService.error; + // setState(ViewState.Error); + // } else { setState(ViewState.Idle); - } + // } } } \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/BrandViewModel.dart b/lib/core/viewModels/pharmacyModule/BrandViewModel.dart index 8ffc057a..c1cdc8bc 100644 --- a/lib/core/viewModels/pharmacyModule/BrandViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/BrandViewModel.dart @@ -11,14 +11,14 @@ class BrandViewModel extends BaseViewModel { List get manufacturerList => _pharmacyService.manufacturerList; Future getTopManufacturerList() async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _pharmacyService.getTopManufacturerList(); - if (_pharmacyService.hasError) { - error = _pharmacyService.error; - setState(ViewState.Error); - } else { + // if (_pharmacyService.hasError) { + // error = _pharmacyService.error; + // setState(ViewState.Error); + // } else { setState(ViewState.Idle); - } + // } } @override diff --git a/lib/core/viewModels/pharmacyModule/LastVisitedViewModel.dart b/lib/core/viewModels/pharmacyModule/LastVisitedViewModel.dart index efc628d6..568e56f8 100644 --- a/lib/core/viewModels/pharmacyModule/LastVisitedViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/LastVisitedViewModel.dart @@ -13,13 +13,13 @@ class LastVisitedViewModel extends BaseViewModel { _pharmacyService.lastVisitedProducts; getLastVisitedProducts() async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _pharmacyService.getLastVisitedProducts(); - if (_pharmacyService.hasError) { - error = _pharmacyService.error; - setState(ViewState.Error); - } else { + // if (_pharmacyService.hasError) { + // error = _pharmacyService.error; + // setState(ViewState.Error); + // } else { setState(ViewState.Idle); - } + // } } } \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart index 3f986bcc..facccf1e 100644 --- a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -40,7 +40,7 @@ class PharmacyModuleViewModel extends BaseViewModel { } Future verifyCustomer() async { - if (authenticatedUserObject.isLogin) await generatePharmacyToken(); + // if (authenticatedUserObject.isLogin) await generatePharmacyToken(); var data = await sharedPref.getObject(USER_PROFILE); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index a34f3b57..4e19386b 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -825,15 +825,11 @@ class _HomePageState extends State { } else { GifLoaderDialogUtils.showMyDialog(context); await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if (pharmacyModuleViewModel.error.isNotEmpty) { - await pharmacyModuleViewModel.verifyCustomer().then((value) { - GifLoaderDialogUtils.hideDialog(context); - Navigator.push(context, FadePage(page: LandingPagePharmacy())); - }); - } else { + + await pharmacyModuleViewModel.verifyCustomer().then((value) { GifLoaderDialogUtils.hideDialog(context); Navigator.push(context, FadePage(page: LandingPagePharmacy())); - } + }); }); } } diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index ee5c077f..c158341d 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -48,10 +48,8 @@ class _PharmacyPageState extends State { return BaseView( onModelReady: (model) async { - // GifLoaderDialogUtils.showMyDialog(context); await model.getSavedLanguage(); await model.getBannerList(); - // GifLoaderDialogUtils.hideDialog(context); }, allowAny: true, builder: (_, model, wi) => AppScaffold( diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart index 40895a00..07abe2db 100644 --- a/lib/pages/pharmacies/widgets/ProductTileItem.dart +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -24,6 +24,7 @@ class ProductTileItem extends StatelessWidget { void _saveLastVisitProducts() async { String lastVisited = ""; bool isIdExist = false; + List items = []; if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) { lastVisited = @@ -32,8 +33,27 @@ class ProductTileItem extends StatelessWidget { if (id == item.id) { isIdExist = true; } + items.add(id); }); } + + if(items.length >= 15){ + items.removeAt(0); + // lastVisited = lastVisited.replaceFirst(RegExp('$itemToRemove'), ''); + } + + lastVisited = ""; + for(int i = items.length - 1; i >= 0; i--){ + if (lastVisited == "") { + // it means there is no lastVisited yet + lastVisited = "${items[i]}"; + } else { + // there is lastVisited id's and this product id is not found + lastVisited += ",${items[i]}"; + } + } + + if (!isIdExist) { if (lastVisited == "") { // it means there is no lastVisited yet @@ -42,8 +62,8 @@ class ProductTileItem extends StatelessWidget { // there is lastVisited id's and this product id is not found lastVisited += ",${item.id}"; } - sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, lastVisited); } + sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, lastVisited); } @override diff --git a/lib/pages/pharmacies/widgets/home/BannerPager.dart b/lib/pages/pharmacies/widgets/home/BannerPager.dart index 29d409eb..a1153bcb 100644 --- a/lib/pages/pharmacies/widgets/home/BannerPager.dart +++ b/lib/pages/pharmacies/widgets/home/BannerPager.dart @@ -59,7 +59,7 @@ class _BannerPagerState extends State { ) : CachedNetworkImage( imageUrl: item, - fit: BoxFit.cover, + fit: BoxFit.fitWidth, errorWidget: (context, url, error) => SizedBox()), ), diff --git a/lib/pages/pharmacies/widgets/home/BestSellerWidget.dart b/lib/pages/pharmacies/widgets/home/BestSellerWidget.dart index 5784acaa..baf771b2 100644 --- a/lib/pages/pharmacies/widgets/home/BestSellerWidget.dart +++ b/lib/pages/pharmacies/widgets/home/BestSellerWidget.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BestSellerViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -26,6 +27,7 @@ class BestSellerWidget extends StatelessWidget { id: "", productType: 20, )), + if (model.state != ViewState.BusyLocal) Container( height: MediaQuery.of(context).size.height / 4 + 20, child: ListView.builder( @@ -34,7 +36,18 @@ class BestSellerWidget extends StatelessWidget { scrollDirection: Axis.horizontal, itemCount: model.bestSellerProduct.length, ), - ), + ) else + Container( + height: 80, + child: Center( + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[500], + ), + ), + ), + ), ], ), ), diff --git a/lib/pages/pharmacies/widgets/home/GridViewCard.dart b/lib/pages/pharmacies/widgets/home/GridViewCard.dart index 99425aa1..a8e3fe9b 100644 --- a/lib/pages/pharmacies/widgets/home/GridViewCard.dart +++ b/lib/pages/pharmacies/widgets/home/GridViewCard.dart @@ -29,10 +29,15 @@ class GridViewCard extends StatelessWidget { flex: 2, child: Padding( padding: const EdgeInsets.all(6), - child: Texts( - text, - color: Colors.white, - fontSize: SizeConfig.textMultiplier * 1.5, + child: Column( + children: [ + Texts( + text, + color: Colors.white, + bold: true, + fontSize: SizeConfig.textMultiplier * 1.5, + ), + ], ), ), ), diff --git a/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart b/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart index b07c6da6..15e9e700 100644 --- a/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart +++ b/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/LastVisitedViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -15,31 +16,44 @@ class RecentlyViewedWidget extends StatelessWidget { onModelReady: (model) => model.getLastVisitedProducts(), allowAny: true, builder: (_, model, wi) => NetworkBaseView( - isLocalLoader: true, - baseViewModel: model, - child: Container( - child: Column( - children: [ - ViewAllHomeWidget( - TranslationBase.of(context).recentlyViewed, - FinalProductsPage( - id: "", - productType: 3, - )), - Container( - height: model.lastVisitedProducts.length > 0 - ? MediaQuery.of(context).size.height / 4 + 20 - : 0, - child: ListView.builder( - itemBuilder: (ctx, i) => - ProductTileItem(model.lastVisitedProducts[i]), - scrollDirection: Axis.horizontal, - itemCount: model.lastVisitedProducts.length, - ), + isLocalLoader: true, + baseViewModel: model, + child: model.lastVisitedProducts.isNotEmpty ? Container( + child: Column( + children: [ + ViewAllHomeWidget( + TranslationBase.of(context).recentlyViewed, + FinalProductsPage( + id: "", + productType: 3, + )), + if (model.state != ViewState.BusyLocal) + Container( + height: model.lastVisitedProducts.length > 0 + ? MediaQuery.of(context).size.height / 4 + 20 + : 0, + child: ListView.builder( + itemBuilder: (ctx, i) => + ProductTileItem(model.lastVisitedProducts[i]), + scrollDirection: Axis.horizontal, + itemCount: model.lastVisitedProducts.length, + ), + ) + else + Container( + height: 80, + child: Center( + child:CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[500], + ), + ), + ), + ), + ], ), - ], - ), - ), - )); + ) : Container(), + )); } -} \ No newline at end of file +} diff --git a/lib/pages/pharmacies/widgets/home/ShopByBrandWidget.dart b/lib/pages/pharmacies/widgets/home/ShopByBrandWidget.dart index 3d892a43..8f4f943d 100644 --- a/lib/pages/pharmacies/widgets/home/ShopByBrandWidget.dart +++ b/lib/pages/pharmacies/widgets/home/ShopByBrandWidget.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BrandViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -15,26 +16,38 @@ class ShopByBrandWidget extends StatelessWidget { onModelReady: (model) => model.getTopManufacturerList(), allowAny: true, builder: (_, model, wi) => NetworkBaseView( - isLocalLoader: true, - baseViewModel: model, - child: Container( - child: Column( - children: [ - ViewAllHomeWidget( - TranslationBase.of(context).shopByBrands, - ProductBrandsPage()), - Container( - height: 100, - child: ListView.builder( - itemBuilder: (ctx, i) => - ManufacturerItem(model.manufacturerList[i]), - scrollDirection: Axis.horizontal, - itemCount: model.manufacturerList.length, - ), + isLocalLoader: true, + baseViewModel: model, + child: Container( + child: Column( + children: [ + ViewAllHomeWidget(TranslationBase.of(context).shopByBrands, + ProductBrandsPage()), + if (model.state != ViewState.BusyLocal) + Container( + height: 100, + child: ListView.builder( + itemBuilder: (ctx, i) => + ManufacturerItem(model.manufacturerList[i]), + scrollDirection: Axis.horizontal, + itemCount: model.manufacturerList.length, + ), + ) + else + Container( + height: 80, + child: Center( + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[500], + ), + ), + ), + ), + ], ), - ], - ), - ), - )); + ), + )); } -} \ No newline at end of file +} diff --git a/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart b/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart index 25981466..05c57f2e 100644 --- a/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart +++ b/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart @@ -14,21 +14,23 @@ class ViewAllHomeWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.fromLTRB(10, 10, 10, 10), + margin: EdgeInsets.fromLTRB(16, 10, 16, 10), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts( title, bold: true, + fontSize: 16, ), BorderedButton( TranslationBase.of(context).viewAll, hasBorder: true, borderColor: Colors.green, textColor: Colors.green, + fontWeight: FontWeight.bold, vPadding: 6, - hPadding: 4, + hPadding: 14, handler: () { Navigator.push( context, diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart index f85faf2c..0f86df23 100644 --- a/lib/services/pharmacy_services/product_detail_service.dart +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -98,7 +98,7 @@ class ProductDetailService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - AppToast.showErrorToast(message: 'something went wrong please try again'); + AppToast.showErrorToast(message: super.error??'something went wrong please try again'); }, body: request); } diff --git a/lib/widgets/buttons/GestureIconButton.dart b/lib/widgets/buttons/GestureIconButton.dart index 841d7ea6..329755f6 100644 --- a/lib/widgets/buttons/GestureIconButton.dart +++ b/lib/widgets/buttons/GestureIconButton.dart @@ -3,12 +3,12 @@ import 'package:flutter/material.dart'; class GestureIconButton extends StatefulWidget { GestureIconButton( - this.label, - this.icon, { - Key key, - this.onTap, - this.backgroundColor, - }) : super(key: key); + this.label, + this.icon, { + Key key, + this.onTap, + this.backgroundColor, + }) : super(key: key); final String label; final Widget icon; @@ -29,41 +29,35 @@ class _GestureIconButtonState extends State { setState(() => _buttonLongPress = !_buttonLongPress), onLongPressEnd: (_) => setState(() => _buttonLongPress = !_buttonLongPress), - child: Wrap( - children: [ - Container( - decoration: BoxDecoration( - border: Border.all( - color: widget.backgroundColor != null - ? widget.backgroundColor - : Colors.grey[200], + child: Container( + decoration: BoxDecoration( + border: Border.all( + color: widget.backgroundColor != null + ? widget.backgroundColor + : Colors.grey[200], + ), + color: widget.backgroundColor != null + ? widget.backgroundColor + : Colors.grey.shade200, + borderRadius: BorderRadius.all(Radius.circular(8))), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.only(right: 8.0), + child: widget.icon, ), - color: widget.backgroundColor != null - ? widget.backgroundColor - : Colors.grey.shade200, - borderRadius: BorderRadius.all(Radius.circular(8))), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Expanded( - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.only(right: 8.0), - child: widget.icon, - ), - Texts( - widget.label, - color: _buttonLongPress ? Colors.white : Colors.black, - ), - ], - ), + Texts( + widget.label, + color: _buttonLongPress ? Colors.white : Colors.black, ), - ), + ], ), ), - ], + ), ), ); } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 87976dcb..93bccbd2 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -224,37 +224,36 @@ class AppBarWidgetState extends State { ), centerTitle: true, actions: [ - (widget.isPharmacy && widget.showPharmacyCart) - ? Container() - // ? IconButton( - // icon: Badge( - // shape: BadgeShape.circle, - // badgeContent: - Text(_badgeText, style: TextStyle(color: Colors.white)), - // child: Icon(Icons.shopping_cart)), - // color: Colors.white, - // onPressed: () { - // Navigator.of(context).popUntil(ModalRoute.withName('/')); - // }) - : Container(), + // (widget.isPharmacy && widget.showPharmacyCart) + // ? Container() + // // ? IconButton( + // // icon: Badge( + // // shape: BadgeShape.circle, + // // badgeContent: + // // Text(_badgeText, style: TextStyle(color: Colors.white)), + // // child: Icon(Icons.shopping_cart)), + // // color: Colors.white, + // // onPressed: () { + // // Navigator.of(context).popUntil(ModalRoute.withName('/')); + // // }) + // : Container(), (widget.isOfferPackages && widget.showOfferPackagesCart) - ? Container() - // ? IconButton( - // icon: Badge( - // position: BadgePosition.topStart(top: -15, start: -10), - // badgeContent: Text( - // _badgeText, - // style: TextStyle( - // fontSize: 9, - // color: Colors.white, - // fontWeight: FontWeight.normal), - // ), - // child: Icon(Icons.shopping_cart)), - // color: Colors.white, - // onPressed: () { - // // Cart Click Event - // if (_onCartClick != null) _onCartClick(); - // }) + ? IconButton( + icon: Badge( + position: BadgePosition.topStart(top: -15, start: -10), + badgeContent: Text( + _badgeText, + style: TextStyle( + fontSize: 9, + color: Colors.white, + fontWeight: FontWeight.normal), + ), + child: Icon(Icons.shopping_cart)), + color: Colors.white, + onPressed: () { + // Cart Click Event + if (_onCartClick != null) _onCartClick(); + }) : Container(), if (widget.showHomeAppBarIcon) IconButton( @@ -375,10 +374,10 @@ class _RobotIcon extends State { bottom: -15); } -// setAnimation() async { -// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || -// // var animation = -// // IS_TEXT_COMPLETED == ? true : false; + // setAnimation() async { + // /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || + // // var animation = + // // IS_TEXT_COMPLETED == ? true : false; -// } + // } }