Merge branch 'pharmacy_fix_bugs' into 'development'

Pharmacy fix bugs

See merge request Cloud_Solution/diplomatic-quarter!430
merge-update-with-lab-changes
Mohammad Aljammal 4 years ago
commit 26c83cd93d

@ -494,8 +494,7 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) {
if (statusCode == 401) {
AppToast.showErrorToast(
message: TranslationBase.of(AppGlobal.context).pharmacyRelogin);
onFailure(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode);
Navigator.of(AppGlobal.context).pushNamed(HOME);
} else {
onFailure('Error While Fetching data', statusCode);

@ -129,7 +129,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
PharmacyPage(),
PharmacyCategorisePage(),
PharmacyProfilePage(),
CartOrderPage(),
CartOrderPage(changeTab: _changeCurrentTab),
],
),
bottomNavigationBar: BottomNavPharmacyBar(

@ -20,21 +20,23 @@ import 'package:http/http.dart';
import 'package:provider/provider.dart';
class CartOrderPage extends StatefulWidget {
const CartOrderPage({Key key}) : super(key: key);
final Function(int) changeTab;
const CartOrderPage({Key key, this.changeTab}) : super(key: key);
@override
_CartOrderPageState createState() => _CartOrderPageState();
}
class _CartOrderPageState extends State<CartOrderPage> {
bool isLoading = true;
@override
void initState() {
super.initState();
getData();
}
@override
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
@ -53,195 +55,194 @@ class _CartOrderPageState extends State<CartOrderPage> {
showHomeAppBarIcon: false,
isShowDecPage: true,
baseViewModel: model,
backButtonTab: widget.changeTab != null ? () => widget.changeTab(0) : null,
backgroundColor: Colors.white,
body: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
model.cartResponse.shoppingCarts.length == 0)
? Container(
height: height * 0.85,
width: double.infinity,
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureIconButton(
TranslationBase.of(context).deleteAllItems,
Icon(
Icons.delete_outline_sharp,
color: Colors.grey.shade700,
),
onTap: () => {model.deleteShoppingCart()},
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
height: height * 0.85,
width: double.infinity,
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
model.cartResponse.shoppingCarts != null
? model.cartResponse.shoppingCarts.length
: 0,
(index) => ProductOrderItem(
model.cartResponse.shoppingCarts[index], () {
print(model.cartResponse.shoppingCarts[index]
.quantity);
model
.changeProductQuantity(
model.cartResponse.shoppingCarts[index])
.then((value) {
if (model.state !=
ViewState.Error) {
appScaffold.appBar.badgeUpdater(
'${value.quantityCount ?? 0}');
}
if (model.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(
model.error);
}
});
}, () {
model
.deleteProduct(
model.cartResponse.shoppingCarts[index])
.then((value) {
if (model.state !=
ViewState.Error) {
appScaffold.appBar.badgeUpdater(
'${value.quantityCount ?? 0}');
}
});
}))
GestureIconButton(
TranslationBase.of(context).deleteAllItems,
Icon(
Icons.delete_outline_sharp,
color: Colors.grey.shade700,
),
onTap: () => {model.deleteShoppingCart()},
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
child: Column(
children: [
...List.generate(
model.cartResponse.shoppingCarts != null
? model.cartResponse.shoppingCarts.length
: 0,
(index) => ProductOrderItem(
model.cartResponse
.shoppingCarts[index], () {
print(model.cartResponse
.shoppingCarts[index].quantity);
model
.changeProductQuantity(model
.cartResponse
.shoppingCarts[index])
.then((value) {
if (model.state != ViewState.Error) {
appScaffold.appBar.badgeUpdater(
'${value.quantityCount ?? 0}');
}
if (model.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
}
});
}, () {
model
.deleteProduct(model.cartResponse
.shoppingCarts[index])
.then((value) {
if (model.state != ViewState.Error) {
appScaffold.appBar.badgeUpdater(
'${value.quantityCount ?? 0}');
}
});
}))
],
),
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 2,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).subtotal,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).vat}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Image.asset(
"assets/images/pharmacy_module/payment_image.png",
width: mediaQuery.size.width - 20,
height: 30.0,
fit: BoxFit.scaleDown,
),
SizedBox(
height: 120,
)
],
),
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 2,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).subtotal,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).vat}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
)
: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/new-design/empty_box.png',
width: 100,
height: 100,
fit: BoxFit.cover,
),
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
TranslationBase.of(context).noData,
// 'There is no data',
style: TextStyle(fontSize: 30),
),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Image.asset(
"assets/images/pharmacy_module/payment_image.png",
width: mediaQuery.size.width - 20,
height: 30.0,
fit: BoxFit.scaleDown,
),
SizedBox(height: 120,)
],
),
),
),
)
: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/new-design/empty_box.png',
width: 100,
height: 100,
fit: BoxFit.cover,
)
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
TranslationBase.of(context).noData,
// 'There is no data',
style: TextStyle(fontSize: 30),
),
)
],
),
),
bottomSheet: Container(
height: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
model.cartResponse.shoppingCarts.length == 0)
? height * 0.15
: 0,
color: Colors.white,
@ -251,13 +252,12 @@ class _CartOrderPageState extends State<CartOrderPage> {
);
}
void getData()async {
await Provider.of<OrderPreviewViewModel>(context, listen: false).getShoppingCart();
void getData() async {
await Provider.of<OrderPreviewViewModel>(context, listen: false)
.getShoppingCart();
setState(() {
isLoading= false;
isLoading = false;
});
}
}
@ -279,148 +279,145 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
ProjectViewModel projectProvider = Provider.of(context);
OrderPreviewViewModel cart = Provider.of(context);
return !(cart.cartResponse.shoppingCarts == null ||
cart.cartResponse.shoppingCarts.length == 0)
cart.cartResponse.shoppingCarts.length == 0)
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Divider(
color: Color(0xFFD6D6D6),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
height: widget.height * 0.070,
color: Color(0xffe6ffe0),
padding: EdgeInsets.symmetric(horizontal: 4),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
setState(() {
isAgree = !isAgree;
});
},
child: Container(
width: 25.0,
height: widget.height * 0.070,
decoration: new BoxDecoration(
color:
!isAgree ? Color(0xffeeeeee) : Colors.green,
shape: BoxShape.circle,
),
child: !isAgree
? null
: Padding(
padding: const EdgeInsets.all(0.0),
child: Icon(
Icons.check,
color: Colors.white,
size: 25,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 4),
margin: const EdgeInsets.symmetric(vertical: 4),
child: Texts(
TranslationBase.of(context)
.pharmacyServiceTermsCondition,
fontSize: 13,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
),
const Divider(
color: Color(0xFFD6D6D6),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
InkWell(
onTap: () => {
Navigator.push(context,
FadePage(page: PharmacyTermsConditions()))
},
child: Container(
child: Icon(
Icons.info,
size: 25,
color: Color(0xff005aff),
),
Container(
height: widget.height * 0.070,
color: Color(0xffe6ffe0),
padding: EdgeInsets.symmetric(horizontal: 4),
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
isAgree = !isAgree;
});
},
child: Container(
width: 25.0,
height: widget.height * 0.070,
decoration: new BoxDecoration(
color: !isAgree ? Color(0xffeeeeee) : Colors.green,
shape: BoxShape.circle,
),
child: !isAgree
? null
: Padding(
padding: const EdgeInsets.all(0.0),
child: Icon(
Icons.check,
color: Colors.white,
size: 25,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 4),
margin: const EdgeInsets.symmetric(vertical: 4),
child: Texts(
TranslationBase.of(context)
.pharmacyServiceTermsCondition,
fontSize: 13,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
),
),
InkWell(
onTap: () => {
Navigator.push(
context, FadePage(page: PharmacyTermsConditions()))
},
child: Container(
child: Icon(
Icons.info,
size: 25,
color: Color(0xff005aff),
),
),
),
],
),
),
],
),
),
Container(
height: widget.height * 0.065,
margin: EdgeInsets.symmetric(vertical: 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
Container(
height: widget.height * 0.065,
margin: EdgeInsets.symmetric(vertical: 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 0, vertical: 0),
child: Row(
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 0, vertical: 0),
child: Row(
children: [
Texts(
"${TranslationBase.of(context).sar} ${(cart.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: projectProvider.isArabic ? 12 : 14,
fontWeight: FontWeight.bold,
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 4),
child: Texts(
"${TranslationBase.of(context).inclusiveVat}",
fontSize: 8,
color: Colors.grey,
fontWeight: FontWeight.bold,
),
),
],
),
),
Texts(
"${TranslationBase.of(context).sar} ${(cart.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize:
projectProvider.isArabic ? 12 : 14,
"${cart.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
fontSize: 10,
color: Colors.grey,
fontWeight: FontWeight.bold,
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 4),
child: Texts(
"${TranslationBase.of(context).inclusiveVat}",
fontSize: 8,
color: Colors.grey,
fontWeight: FontWeight.bold,
),
),
],
),
),
Texts(
"${cart.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
fontSize: 10,
color: Colors.grey,
fontWeight: FontWeight.bold,
RaisedButton(
onPressed: isAgree
? () => {
Navigator.push(
context,
FadePage(
page:
OrderPreviewPage(widget.addresses)))
}
: null,
child: new Text(
"${TranslationBase.of(context).checkOut}",
style: new TextStyle(
color:
isAgree ? Colors.white : Colors.grey.shade300,
fontSize: 14),
),
color: Color(0xff005aff),
disabledColor: Color(0xff005aff),
),
],
),
),
RaisedButton(
onPressed: isAgree
? () => {
Navigator.push(
context,
FadePage(
page: OrderPreviewPage(
widget.addresses)))
}
: null,
child: new Text(
"${TranslationBase.of(context).checkOut}",
style: new TextStyle(
color: isAgree
? Colors.white
: Colors.grey.shade300,
fontSize: 14),
),
color: Color(0xff005aff),
disabledColor: Color(0xff005aff),
),
],
),
),
],
)
)
: Container();
}
}

@ -1,44 +1,15 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BestSellerViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BrandViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/LastVisitedViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PrescriptionViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/recommended-product-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/BannerPager.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/BestSellerWidget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/GridViewButtons.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/PrescriptionsWidget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ShopByBrandWidget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import '../../../locator.dart';
import '../../final_products_page.dart';
class PharmacyPage extends StatefulWidget {
@override

@ -154,6 +154,7 @@ class ProductDetailService extends BaseService {
super.error = error;
});
}
Future deleteItemFromWishlist(itemID) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false;
@ -163,9 +164,11 @@ class ProductDetailService extends BaseService {
response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item));
});
AppToast.showSuccessToast(message: 'You have removed a product from the Wishlist');
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
AppToast.showErrorToast(message: error??Utils.generateContactAdminMessage());
});
}

@ -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';
@ -29,8 +30,6 @@ import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart';
import 'network_base_view.dart';
import 'not_auh_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
VoidCallback _onCartClick;
@ -59,6 +58,8 @@ class AppScaffold extends StatelessWidget {
final List<ImagesInfo> imagesInfo;
final bool isHelp;
final bool isLocalLoader;
final Function backButtonTab;
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@ -90,7 +91,9 @@ class AppScaffold extends StatelessWidget {
this.showHomeAppBarIcon = true,
this.imagesInfo,
appBar,
this.customAppBar, this.isLocalLoader= false});
this.customAppBar,
this.isLocalLoader = false,
this.backButtonTab});
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
_onCartClick = onClick;
@ -115,6 +118,7 @@ class AppScaffold extends StatelessWidget {
isOfferPackages: isOfferPackages,
showOfferPackagesCart: showOfferPackagesCart,
isShowDecPage: isShowDecPage,
backButtonTab: backButtonTab,
)
: null,
bottomSheet: bottomSheet,
@ -146,18 +150,18 @@ class AppScaffold extends StatelessWidget {
}
buildBodyWidget(context) {
return Stack(
children: <Widget>[
Center(
child:isLoading? CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500],
),
):body),
isHelp == true ? RobotIcon() : Container()]);
return Stack(children: <Widget>[
Center(
child: isLoading
? CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500],
),
)
: body),
isHelp == true ? RobotIcon() : Container()
]);
}
}
@ -174,6 +178,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
final bool showOfferPackagesCart;
final bool isShowDecPage;
final Function backButtonTab;
Function(String) badgeUpdater;
AppBarWidget(
@ -184,6 +189,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
this.showPharmacyCart = true,
this.isOfferPackages = false,
this.showOfferPackagesCart = false,
this.backButtonTab,
this.isShowDecPage = true});
@override
@ -210,6 +216,8 @@ class AppBarWidgetState extends State<AppBarWidget> {
Widget buildAppBar(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
return AppBar(
elevation: 0,
backgroundColor: widget.isPharmacy
@ -230,7 +238,9 @@ class AppBarWidgetState extends State<AppBarWidget> {
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
return ArrowBack(
onTap: widget.backButtonTab,
);
},
),
centerTitle: true,
@ -253,7 +263,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
icon: Badge(
position: BadgePosition.topStart(top: -15, start: -10),
badgeContent: Text(
_badgeText,
orderPreviewViewModel.cartResponse.quantityCount.toString() /*_badgeText*/,
style: TextStyle(
fontSize: 9,
color: Colors.white,
@ -385,10 +395,10 @@ class _RobotIcon extends State<RobotIcon> {
bottom: -15);
}
// setAnimation() async {
// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) ||
// // var animation =
// // IS_TEXT_COMPLETED == ? true : false;
// setAnimation() async {
// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) ||
// // var animation =
// // IS_TEXT_COMPLETED == ? true : false;
// }
// }
}

@ -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<OrderPreviewViewModel>(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<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