pharmacy cart and wishlist fixes

merge-update-with-lab-changes
mosazaid 5 years ago
parent 9a1dc3c678
commit b779c250a4

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
@ -215,6 +216,8 @@ class AppBarWidgetState extends State<AppBarWidget> {
Widget buildAppBar(BuildContext context) { Widget buildAppBar(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
return AppBar( return AppBar(
elevation: 0, elevation: 0,
backgroundColor: widget.isPharmacy backgroundColor: widget.isPharmacy
@ -260,7 +263,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
icon: Badge( icon: Badge(
position: BadgePosition.topStart(top: -15, start: -10), position: BadgePosition.topStart(top: -15, start: -10),
badgeContent: Text( badgeContent: Text(
_badgeText, orderPreviewViewModel.cartResponse.quantityCount.toString() /*_badgeText*/,
style: TextStyle( style: TextStyle(
fontSize: 9, fontSize: 9,
color: Colors.white, color: Colors.white,

@ -34,6 +34,9 @@ class BottomNavPharmacyItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
ProjectViewModel projectViewModel = Provider.of(context);
return Expanded( return Expanded(
child: SizedBox( child: SizedBox(
// height: 72.0, // height: 72.0,
@ -97,7 +100,7 @@ class BottomNavPharmacyItem extends StatelessWidget {
), ),
), ),
), ),
if(currentIndex == 3 &&Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount !=0) if(projectViewModel.isLogin && currentIndex == 3 && orderPreviewViewModel.cartResponse.quantityCount !=0)
Positioned( Positioned(
top: 5, right: -3.5, top: 5, right: -3.5,
child: Container( child: Container(
@ -108,7 +111,7 @@ class BottomNavPharmacyItem extends StatelessWidget {
), ),
padding: EdgeInsets.only(left: 5, right: 4.5), padding: EdgeInsets.only(left: 5, right: 4.5),
height: 18, height: 18,
child: Center(child: Texts(Provider.of<OrderPreviewViewModel>(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,)),
), ),
) )
], ],

Loading…
Cancel
Save