Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into pharmacy_fix

merge-requests/401/head
hussam al-habibeh 4 years ago
commit cb2b9db0ab

@ -121,9 +121,9 @@ class PharmacyModuleService extends BaseService {
manufacturerList.clear();
response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item);
if (manufacturer.image != null) {
// if (manufacturer.image != null) {
manufacturerList.add(Manufacturer.fromJson(item));
}
// }
});
}, onFailure: (String error, int statusCode) {
hasError = true;

@ -9,36 +9,15 @@ class PrescriptionService extends BaseService {
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
String url = "";
List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList;
// Future getPrescription() async {
// hasError = false;
// url = PRESCRIPTION;
// print("Print PRESCRIPTION url" + url);
// await baseAppClient.get(url,
// onSuccess: (dynamic response, int statusCode) {
// _prescriptionsList.clear();
// response['PatientPrescriptionList'].forEach((item) {
// _prescriptionsList.add(Prescriptions.fromJson(item));
// });
// print(_prescriptionsList.length);
// print(response);
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// });
// }
Future getPrescription() async {
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
print("Print PRESCRIPTION url" + url);
await baseAppClient.post(url,
await baseAppClient.post(PRESCRIPTION,
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) {

@ -344,6 +344,7 @@ class PharmacyCategoriseService extends BaseService {
}
Future getMostViewedProducts() async {
hasError = false;
Map<String, String> queryParams = {
'fields':
'mostview?fields=id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage',
@ -362,7 +363,9 @@ class PharmacyCategoriseService extends BaseService {
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
hasError = true;
super.error = error.toString();
// throw error;
}
}

@ -15,6 +15,7 @@ class BaseViewModel extends ChangeNotifier {
ViewState get state => _state;
String error = "";
String languageID = "en";
AuthenticatedUser user;
AppSharedPreferences sharedPref = AppSharedPreferences();
@ -51,6 +52,10 @@ class BaseViewModel extends ChangeNotifier {
notifyListeners();
}
Future getSavedLanguage() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
@override
void dispose() {
removeListener(() {});

@ -0,0 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
class BestSellerViewModel extends BaseViewModel {
}

@ -0,0 +1,29 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
class BrandViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
Future getTopManufacturerList() async {
setState(ViewState.Busy);
await _pharmacyService.getTopManufacturerList();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
@override
void dispose() {
super.dispose();
}
}

@ -0,0 +1,25 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
class LastVisitedViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts;
getLastVisitedProducts() async {
setState(ViewState.Busy);
await _pharmacyService.getLastVisitedProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -0,0 +1,30 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:provider/provider.dart';
import '../../../locator.dart';
import '../project_view_model.dart';
class PrescriptionViewModel extends BaseViewModel {
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList;
getPrescription() async {
await getSavedLanguage();
/*
setState(ViewState.Busy);
await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}*/
}
}

@ -16,34 +16,30 @@ import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProdu
import '../../../locator.dart';
class PharmacyModuleViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>();
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
RecommendedProductService _recommendedProductService = locator<RecommendedProductService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
List<PharmacyProduct> get bestSellerProduct =>
_pharmacyService.bestSellerProducts;
List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts;
List <RecommendedProductModel> get recommendedProductList =>
_recommendedProductService.recommendedList;
// List<Map<String, dynamic>> get recommendedProductList =>
// _recommendedProductService.recommendedList;
List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList;
bool hasError = false;
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getBannerList() async {
setState(ViewState.BusyLocal);
await _pharmacyService.getBannerListList();
if (_pharmacyService.hasError)
//{
error = _pharmacyService.error;
// setState(ViewState.Error);
// }else
// setState(ViewState.Idle);
}
Future getPharmacyHomeData() async {
if(authenticatedUserObject.isLogin)
@ -58,11 +54,7 @@ class PharmacyModuleViewModel extends BaseViewModel {
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
await getBannerList();
}
} else {
await getBannerList();
}
}
@ -76,7 +68,6 @@ class PharmacyModuleViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future generatePharmacyToken() async {
setState(ViewState.Busy);
await _pharmacyService.generatePharmacyToken();
@ -88,16 +79,6 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
}
Future getBannerList() async {
setState(ViewState.Busy);
await _pharmacyService.getBannerListList();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
_getTopManufacturerList();
}
}
List<String> getBannerImagesUrl() {
List<String> images = List();
@ -109,40 +90,18 @@ class PharmacyModuleViewModel extends BaseViewModel {
return images;
}
_getTopManufacturerList() async {
await _pharmacyService.getTopManufacturerList();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
_getBestSellerProducts();
}
}
_getBestSellerProducts() async {
getBestSellerProducts() async {
await _pharmacyService.getBestSellerProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
_getLastVisitedProducts();
}
}
_getLastVisitedProducts() async {
await _pharmacyService.getLastVisitedProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
//////////////////////////////////////////RecommendedProducts
getRecommendedProducts(productId) async {
hasError = false;
setState(ViewState.Busy);
await _recommendedProductService.getRecommendedProducts(productId);
if (_recommendedProductService.hasError) {
@ -167,18 +126,6 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
}
getPrescription() async {
print("Print PRESCRIPTION url");
setState(ViewState.Busy);
await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
///////////////////////or
// getPrescriptions() async {

@ -120,6 +120,10 @@ import 'core/viewModels/pharmacies_view_model.dart';
import 'core/service/pharmacies_service.dart';
import 'core/service/insurance_service.dart';
import 'core/viewModels/insurance_card_View_model.dart';
import 'core/viewModels/pharmacyModule/BestSellerViewModel.dart';
import 'core/viewModels/pharmacyModule/BrandViewModel.dart';
import 'core/viewModels/pharmacyModule/LastVisitedViewModel.dart';
import 'core/viewModels/pharmacyModule/PrescriptionViewModel.dart';
import 'core/viewModels/pharmacyModule/brand_view_model.dart';
import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'core/viewModels/pharmacyModule/product_detail_view_model.dart';
@ -302,6 +306,11 @@ void setupLocator() {
locator.registerFactory(() => OffersCategoriseViewModel());
locator.registerFactory(() => BariatricsViewModel());
locator.registerFactory(() => PrescriptionViewModel());
locator.registerFactory(() => BrandViewModel());
locator.registerFactory(() => BestSellerViewModel());
locator.registerFactory(() => LastVisitedViewModel());
// Offer And Packages
//----------------------
locator.registerLazySingleton(

@ -49,6 +49,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Widget build(BuildContext context) {
return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) {
//TODO Elham* fix all services in order handel errors in better way in the service
if (widget.productType == 1) {
model.getFinalProducts(i: id);
appBarTitle = TranslationBase.of(context).products;
@ -76,7 +78,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
isBottomBar: false,
isShowAppBar: true,
backgroundColor: Colors.white,
isShowDecPage: false,
isShowDecPage: true,
baseViewModel: model,
body: Container(
height: MediaQuery.of(context).size.height * 5.87,

@ -110,35 +110,6 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
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<LandingPagePharmacy> {
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<LandingPagePharmacy> {
.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) {

@ -93,12 +93,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
if (customerId != null) {
itemID = widget.product.id;
checkWishlist();
// getSpecificationData(itemID);
}
print("customerId:$customerId");
setState(() {});
// getSpecificationData(itemID);
}
Widget build(BuildContext context) {
@ -943,6 +941,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
isShowAppBar: true,
isPharmacy: true,
isShowDecPage: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
body: SingleChildScrollView(
child: Column(
children: [

File diff suppressed because it is too large Load Diff

@ -52,102 +52,99 @@ class ProductTileItem extends StatelessWidget {
return InkWell(
onTap: () => productOnClick(context),
splashColor: Theme.of(context).primaryColor,
child: Card(
elevation: 2,
shape: Border(right: BorderSide(color: Colors.grey.shade300, width: 1)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 0,
child: Container(
margin: EdgeInsets.all(7),
decoration: BoxDecoration(
border:Border.all(color: Colors.grey.shade300,width: 0.5),
borderRadius: BorderRadius.circular(8)
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center,
child: (item.images != null && item.images.length > 0)
? Image.network(
item.images[0].src,
fit: BoxFit.cover,
height: 80,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 80,
),
padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 2.8,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center,
child: (item.images != null && item.images.length > 0)
? Image.network(
item.images[0].src,
fit: BoxFit.cover,
height: 80,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 80,
),
Container(
width: item.rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: item.rxMessage != null ? Texts(
projectProvider.isArabic ? item.rxMessagen : item.rxMessage,
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
): Texts(""),
),
Container(
width: item.rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: item.rxMessage != null
? Texts(
projectProvider.isArabic
? item.rxMessagen
: item.rxMessage,
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
: Texts(""),
)
],
),
SizedBox(height: 8,),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
projectProvider.isArabic ? item.namen : item.name,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w400,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
projectProvider.isArabic ? item.namen : item.name,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w400,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${item.price}",
fontWeight: FontWeight.w600,
fontSize: 14,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${item.price}",
bold: true,
fontSize: 14,
),
Row(
children: [
Expanded(
child: StarRating(
totalAverage: item.approvedTotalReviews > 0
? (item.approvedRatingSum.toDouble() /
item.approvedTotalReviews.toDouble())
.toDouble()
: 0,
forceStars: true),
),
),
Row(
children: [
Expanded(
child: StarRating(
totalAverage: item.approvedTotalReviews > 0
? (item.approvedRatingSum.toDouble() /
item.approvedTotalReviews.toDouble())
.toDouble()
: 0,
forceStars: true),
),
/*Texts(
"(${item.approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),*/
],
),
],
),
)
],
),
],
),
],
),
),
SizedBox(height: 5,),
],
),
),
);

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -23,28 +24,31 @@ class ManufacturerItem extends StatelessWidget {
),
);
},
child: Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 8,
horizontal: 12,
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
border: Border(
right: BorderSide(color: Colors.grey.shade300, width: 1),
bottom: BorderSide(color: Colors.grey.shade300, width: 1),
left: BorderSide(color: Colors.grey.shade300, width: 1),
top: BorderSide(color: Colors.grey.shade300, width: 1)),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Image.network(
item.image.src,
fit: BoxFit.cover,
),
),
decoration: BoxDecoration(
borderRadius:BorderRadius.circular(12) ,
border: Border(
right: BorderSide(color: Colors.grey.shade300, width: 1),
bottom: BorderSide(color: Colors.grey.shade300, width: 1),
left: BorderSide(color: Colors.grey.shade300, width: 1),
top: BorderSide(color: Colors.grey.shade300, width: 1)),
),
child: item.image == null
? Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
child: AppText(item.name, fontWeight: FontWeight.w500,fontSize: 14,),
)
: Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Image.network(
item.image.src,
fit: BoxFit.cover,
),
),
),
);
}

@ -93,7 +93,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
},
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount,
isShowAppBar: true,
isShowAppBar: false,
isShowDecPage: false,
isPharmacy: true,
body: user != null

@ -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) {

@ -30,7 +30,7 @@ class StarRating extends StatelessWidget {
)
),
if (totalCount!=null)
SizedBox(width: 9.0),
SizedBox(width: 5.0),
if (totalCount!=null)
Texts("("+totalCount.toString()+")", style: "overline", color: Colors.grey[400],)
]

@ -183,20 +183,6 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
),
centerTitle: true,
actions: <Widget>[
isPharmacy
? IconButton(
icon: Icon(Icons.shopping_cart),
color: Colors.grey,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CartOrderPage()),
);
// Navigator.of(context)
// .popUntil(ModalRoute.withName('/'));
})
: Container(),
image != null
? InkWell(
onTap: () => Navigator.push(

@ -9,8 +9,9 @@ import 'package:flutter_gifimage/flutter_gifimage.dart';
class NetworkBaseView extends StatefulWidget {
final BaseViewModel baseViewModel;
final Widget child;
final bool isLocalLoader;
NetworkBaseView({Key key, this.baseViewModel, this.child});
NetworkBaseView({Key key, this.baseViewModel, this.child, this.isLocalLoader = false});
@override
_NetworkBaseViewState createState() => _NetworkBaseViewState();
@ -42,7 +43,19 @@ class _NetworkBaseViewState extends State<NetworkBaseView>{
return widget.child;
break;
case ViewState.Busy:
return Container(
if(widget.isLocalLoader)
return Container(
height: 100,
child: Center(
child:CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.red,
),
),
),
);
else return Container(
height: MediaQuery.of(context).size.height,
child: Stack(

@ -17,7 +17,6 @@ class BottomNavPharmacyBar extends StatefulWidget {
}
class _BottomNavPharmacyBarState extends State<BottomNavPharmacyBar> {
int _index = 0;
_changeIndex(int index) {
widget.changeIndex(index);
@ -43,19 +42,6 @@ class _BottomNavPharmacyBarState extends State<BottomNavPharmacyBar> {
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<BottomNavPharmacyBar> {
currentIndex: 1,
title: TranslationBase.of(context).categorise,
),
// Expanded(
// child: SizedBox(
// height: 50,
// child: Column(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// 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<BottomNavPharmacyBar> {
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<BottomNavPharmacyBar> {
activeIcon: EvaIcons.shoppingCartOutline,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 4,
currentIndex: 3,
title: TranslationBase.of(context).cart)
],
),

@ -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<ProjectViewModel>(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,

Loading…
Cancel
Save