diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index 5da853fb..cb886f2d 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -110,35 +110,6 @@ class _LandingPagePharmacyState extends State { centerTitle: true, ) : null, - // : AppBar( - // backgroundColor: Color(0xff5AB145), - // elevation: 0, - // textTheme: TextTheme( - // headline6: TextStyle( - // color: Colors.white, fontWeight: FontWeight.bold), - // ), - // title: Text(getText(currentTab).toUpperCase()), - // leading: Builder( - // builder: (BuildContext context) { - // return IconButton( - // icon: Icon(Icons.arrow_back), - // color: Colors.white, - // onPressed: () => Scaffold.of(context).openDrawer(), - // ); - // }, - // ), - // actions: [ - // // IconButton( - // // iconSize: 70, - // // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', - // // height: 100, width: 100, fit: BoxFit.cover), - // // onPressed: () { - // // triggerRobot(); - // // } //do something, - // // ) - // ], - // centerTitle: true, - // ), extendBody: false, body: PageView( physics: NeverScrollableScrollPhysics(), @@ -146,14 +117,9 @@ class _LandingPagePharmacyState extends State { children: [ PharmacyPage(), PharmacyCategorisePage(), -// OffersCategorisePage(), - WishlistPage(false), PharmacyProfilePage(), -// Container( -// child: Text('text'), -// ), CartOrderPage(), - ], // Please do not remove the BookingOptions from this array + ], ), bottomNavigationBar: BottomNavPharmacyBar( changeIndex: _changeCurrentTab, @@ -172,7 +138,7 @@ class _LandingPagePharmacyState extends State { .getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) { print(response); - product = PharmacyProduct.fromJson(response["products"][0]); + var product = PharmacyProduct.fromJson(response["products"][0]); GifLoaderDialogUtils.hideDialog(context); Navigator.push(context, FadePage(page: ProductDetailPage(product))); }, onFailure: (String error, int statusCode) { diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 918e9668..3cf28592 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -93,7 +93,7 @@ class _ProfilePageState extends State { }, builder: (_, model, wi) => AppScaffold( appBarTitle: TranslationBase.of(context).myAccount, - isShowAppBar: true, + isShowAppBar: false, isShowDecPage: false, isPharmacy: true, body: user != null diff --git a/lib/services/pharmacy_services/wishList_service.dart b/lib/services/pharmacy_services/wishList_service.dart index 5404a2bd..fb99e038 100644 --- a/lib/services/pharmacy_services/wishList_service.dart +++ b/lib/services/pharmacy_services/wishList_service.dart @@ -55,9 +55,10 @@ class WishListService extends BaseService { // } Future getWishlist() async { - var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + //TODO we need to check why the customer id comes null + String customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID)?? "0"; hasError = false; - await baseAppClient.getPharmacy(GET_WISHLIST+customerId+"?shopping_cart_type=2", + await baseAppClient.getPharmacy(GET_WISHLIST+customerId +"?shopping_cart_type=2", onSuccess: (dynamic response, int statusCode) { _wishListProducts.clear(); response['shopping_carts'].forEach((item) { diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_bar.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_bar.dart index 237b4cae..ef861c56 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_bar.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_bar.dart @@ -17,7 +17,6 @@ class BottomNavPharmacyBar extends StatefulWidget { } class _BottomNavPharmacyBarState extends State { - int _index = 0; _changeIndex(int index) { widget.changeIndex(index); @@ -43,19 +42,6 @@ class _BottomNavPharmacyBarState extends State { currentIndex: 0, title: TranslationBase.of(context).Alhabibapp, ), - - // Container( - // height: 65.0, - // child: Center( - // child: VerticalDivider( - // color: Colors.grey, - // thickness: 0.5, - // width: 0.3, - // indent: 25.5, - // ), - // ), - // ), - BottomNavPharmacyItem( icon: EvaIcons.list, activeIcon: EvaIcons.list, @@ -64,20 +50,6 @@ class _BottomNavPharmacyBarState extends State { currentIndex: 1, title: TranslationBase.of(context).categorise, ), -// Expanded( -// child: SizedBox( -// height: 50, -// child: Column( -// mainAxisSize: MainAxisSize.min, -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// SizedBox(height: 22), -// ], -// ), -// ), -// ), - - // Added Calendar Icon to access book appointment flow BottomNavPharmacyItem( icon: EvaIcons.home, activeIcon: EvaIcons.home, @@ -86,13 +58,12 @@ class _BottomNavPharmacyBarState extends State { currentIndex: 0, isHome: true, title: TranslationBase.of(context).home), - BottomNavPharmacyItem( icon: EvaIcons.person, activeIcon: EvaIcons.person, changeIndex: _changeIndex, index: widget.index, - currentIndex: 3, + currentIndex: 2, title: TranslationBase.of(context).myAccount, ), BottomNavPharmacyItem( @@ -100,7 +71,7 @@ class _BottomNavPharmacyBarState extends State { activeIcon: EvaIcons.shoppingCartOutline, changeIndex: _changeIndex, index: widget.index, - currentIndex: 4, + currentIndex: 3, title: TranslationBase.of(context).cart) ], ), diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart index bff756f1..f31fa588 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart @@ -1,6 +1,10 @@ import 'package:diplomaticquarterapp/Constants.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class BottomNavPharmacyItem extends StatelessWidget { final String title; @@ -33,7 +37,16 @@ class BottomNavPharmacyItem extends StatelessWidget { child: InkWell( highlightColor: Colors.transparent, splashColor: Colors.transparent, - onTap: () => changeIndex(currentIndex), + onTap: () { + if(!Provider.of(context, listen: false).isLogin && (currentIndex == 2|| currentIndex == 3)) + Navigator.push( + context, + FadePage(page: WelcomeLogin()), + ); + else + changeIndex(currentIndex); + + }, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center,