diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 6a40b935..f5ce682a 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; @@ -215,6 +216,8 @@ class AppBarWidgetState extends State { Widget buildAppBar(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + OrderPreviewViewModel orderPreviewViewModel = Provider.of(context); + return AppBar( elevation: 0, backgroundColor: widget.isPharmacy @@ -260,7 +263,7 @@ class AppBarWidgetState extends State { icon: Badge( position: BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( - _badgeText, + orderPreviewViewModel.cartResponse.quantityCount.toString() /*_badgeText*/, style: TextStyle( fontSize: 9, color: Colors.white, diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart index 94e260d0..1b8eaefa 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart @@ -34,6 +34,9 @@ class BottomNavPharmacyItem extends StatelessWidget { @override Widget build(BuildContext context) { + OrderPreviewViewModel orderPreviewViewModel = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); + return Expanded( child: SizedBox( // height: 72.0, @@ -97,7 +100,7 @@ class BottomNavPharmacyItem extends StatelessWidget { ), ), ), - if(currentIndex == 3 &&Provider.of(context, listen: false).cartResponse.quantityCount !=0) + if(projectViewModel.isLogin && currentIndex == 3 && orderPreviewViewModel.cartResponse.quantityCount !=0) Positioned( top: 5, right: -3.5, child: Container( @@ -108,7 +111,7 @@ class BottomNavPharmacyItem extends StatelessWidget { ), padding: EdgeInsets.only(left: 5, right: 4.5), height: 18, - child: Center(child: Texts(Provider.of(context, listen: false).cartResponse.quantityCount.toString(), style: "caption", medium: true, color: Colors.white,)), + child: Center(child: Texts(orderPreviewViewModel.cartResponse.quantityCount.toString(), style: "caption", medium: true, color: Colors.white,)), ), ) ],