diff --git a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart index 367e0d35..8069d0ed 100644 --- a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart +++ b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; @@ -63,16 +65,35 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { if (authenticatedUserObject.isLogin) Row( children: [ - IconWithBg( - icon: Icons.shopping_cart, - color: Colors.grey[800], - onPress: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CartOrderPage()), - ); - }), + Stack( + children: [ + IconWithBg( + icon: Icons.shopping_cart, + color: Colors.grey[800], + onPress: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CartOrderPage()), + ); + }), + + if(Provider.of(context, listen: false).cartResponse.quantityCount !=0) + Positioned( + top:0, right: -1.0, + child: Container( + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(15), + + ), + 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,)), + ), + ) + ], + ), SizedBox( width: 10, ),