Merge branch 'fix_product_tile' into 'development'

Fix product tile

See merge request Cloud_Solution/diplomatic-quarter!421
merge-requests/422/merge
Mohammad Aljammal 5 years ago
commit f736ab5365

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:flutter/material.dart';
class ShoppingCartResponse with ChangeNotifier {
class ShoppingCartResponse {
int itemCount;
int quantityCount;
double subtotal;
@ -11,17 +11,15 @@ class ShoppingCartResponse with ChangeNotifier {
List<ShoppingCart> shoppingCarts;
ShoppingCartResponse(
{this.itemCount,
this.quantityCount,
this.subtotal,
this.subtotalWithVat,
this.subtotalVatAmount,
this.subtotalVatRate,
{this.itemCount =0,
this.quantityCount =0,
this.subtotal=0.0,
this.subtotalWithVat = 0.0,
this.subtotalVatAmount = 0.0,
this.subtotalVatRate = 0.0 ,
this.shoppingCarts});
void updateShoppingCard() {
notifyListeners();
}
ShoppingCartResponse.fromJson(Map<String, dynamic> json) {
itemCount = json['item_count'];

@ -114,7 +114,6 @@ class OrderPreviewViewModel extends BaseViewModel {
cartResponse.shoppingCarts.add(shoppingCart);
totalAdditionalShippingCharge += shoppingCart.product.additionalShippingCharge;
});
cartResponse.updateShoppingCard();
return cartResponse;
}

@ -12,20 +12,9 @@ class WishListViewModel extends BaseViewModel{
bool hasError = false;
// Future getWishlistData() async {
// setState(ViewState.Busy);
// await _wishlistService.getWishlist();
// if (_wishlistService.hasError) {
// error = _wishlistService.error;
// setState(ViewState.Error);
// } else {
// setState(ViewState.Idle);
// }
// }
Future getWishlistData() async {
Future getWishlistData({isLocalLoader = false}) async {
hasError = false;
setState(ViewState.Busy);
setState(isLocalLoader ? ViewState.BusyLocal:ViewState.Busy);
await _wishlistService.getWishlist();
if (_wishlistService.hasError) {
error = _wishlistService.error;

@ -294,7 +294,7 @@ void setupLocator() {
locator.registerFactory(() => ProductDetailViewModel());
locator.registerFactory(() => WeatherViewModel());
locator.registerFactory(() => OrderPreviewViewModel());
// locator.registerFactory(() => OrderPreviewViewModel());
locator.registerFactory(() => LacumViewModel());
locator.registerFactory(() => LacumTranferViewModel());
locator.registerFactory(() => LacumRegistrationViewModel());

@ -13,6 +13,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
import 'config/size_config.dart';
import 'core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
import 'pages/pharmacies/compare-list.dart';
@ -79,6 +80,8 @@ class _MyApp extends State<MyApp> {
),
ChangeNotifierProvider<CompareList>(
create: (context) => CompareList()),
ChangeNotifierProvider<OrderPreviewViewModel>(
create: (context) => OrderPreviewViewModel()),
],
child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp(

@ -31,8 +31,6 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail>{
@override
Widget build(BuildContext context) {
getLanguageID();
return BaseView<PackagesViewModel>(
onModelReady: (model){
viewModel = model;

@ -1,65 +1,39 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/wishlist_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/product_tile.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/wishlist_view_model.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
AppSharedPreferences sharedPref = AppSharedPreferences();
var languageID;
import 'package:provider/provider.dart';
class ProductCheckTypeWidget extends StatefulWidget {
final List<dynamic> wishlist;
final bool isTrue;
final WishListViewModel model;
ProductCheckTypeWidget(this.isTrue, this.wishlist);
ProductCheckTypeWidget({this.model});
@override
_ProductCheckTypeWidgetState createState() => _ProductCheckTypeWidgetState();
}
class _ProductCheckTypeWidgetState extends State<ProductCheckTypeWidget> {
void initState() {
getLanguageID();
}
@override
Widget build(BuildContext context) {
return widget.isTrue
? ListView.builder(
itemCount: widget.wishlist.length,
ProjectViewModel projectViewModel = Provider.of(context);
return ListView.builder(
itemCount: widget.model.wishListList.length,
itemBuilder: (BuildContext context, int index) {
return Column(
children: [
Container(
child: widget.isTrue
? productTile(
productName: languageID == 'ar'
? widget.wishlist[index].product.namen
: widget.wishlist[index].product.name,
productPrice: widget.wishlist[index].subtotal,
productRate: double.parse(
widget.wishlist[index].subtotalVatRate),
productImage:
widget.wishlist[index].product.images[0].src,
showLine: widget.isTrue,
productID: widget.wishlist[index].product.id,
onDelete: deleteWishListItem,
)
: productTile(
productName: languageID == 'ar'
? widget.wishlist[index].product.namen
: widget.wishlist[index].product.name,
productPrice: widget.wishlist[index].subtotal,
productRate: double.parse(
widget.wishlist[index].subtotalVatRate),
productImage:
widget.wishlist[index].product.images[0].src,
showLine: widget.isTrue,
child: productTile(
productName: projectViewModel.isArabic
? widget.model.wishListList[index].product.namen
: widget.model.wishListList[index].product.name,
productPrice: widget.model.wishListList[index].subtotal,
productRate: double.parse(widget.model.wishListList[index].subtotalVatRate),
productImage: widget.model.wishListList[index].product.images[0].src,
productID: widget.model.wishListList[index].product.id,
onDelete: deleteWishListItem,
),
@ -67,47 +41,18 @@ class _ProductCheckTypeWidgetState extends State<ProductCheckTypeWidget> {
Divider(height: 1, color: Colors.grey)
],
);
})
: GridView.count(
crossAxisCount: 2,
children: List.generate(
widget.wishlist.length,
(index) => productTile(
productName: widget.wishlist[index].product.name,
productPrice: widget.wishlist[index].subtotal,
productRate:
double.parse(widget.wishlist[index].subtotalVatRate),
productImage:
widget.wishlist[index].product.images[0].src,
showLine: widget.isTrue,
)),
);
});
}
deleteWishListItem(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel();
GifLoaderDialogUtils.showMyDialog(context);
await x.deleteWishlistData(itemID);
setState(()
async{
await
//getWishlistData();
Navigator.push(context,
FadePage(page: WishlistPage(false)),
);
});
await widget.model.getWishlistData(isLocalLoader: true);
GifLoaderDialogUtils.hideDialog(context);
print("Delete");
}
getWishlistData() async {
WishListViewModel x = new WishListViewModel();
await x.getWishlistData();
}
}
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}

@ -12,32 +12,41 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.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';
class CartOrderPage extends StatelessWidget {
class CartOrderPage extends StatefulWidget {
const CartOrderPage({Key key}) : super(key: key);
@override
_CartOrderPageState createState() => _CartOrderPageState();
}
class _CartOrderPageState extends State<CartOrderPage> {
@override
void initState() {
super.initState();
Provider.of<OrderPreviewViewModel>(context, listen: false).getShoppingCart();
}
@override
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
OrderPreviewViewModel model = Provider.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
AppScaffold appScaffold;
return BaseView<OrderPreviewViewModel>(
onModelReady: (model) {
model.getShoppingCart().then((value) {
appScaffold.appBar
.badgeUpdater('${model.cartResponse.quantityCount ?? 0}');
});
},
builder: (_, model, wi) => ChangeNotifierProvider.value(
value: model.cartResponse,
child: appScaffold = AppScaffold(
return NetworkBaseView(
baseViewModel: model,
child: AppScaffold(
appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: true,
isPharmacy: true,
showHomeAppBarIcon: false,
isShowDecPage: true,
description: "",
baseViewModel: model,
backgroundColor: Colors.white,
body: !(model.cartResponse.shoppingCarts == null ||
@ -45,8 +54,6 @@ class CartOrderPage extends StatelessWidget {
? Container(
height: height * 0.85,
width: double.infinity,
child: Consumer<ShoppingCartResponse>(
builder: (ctx, cart, _) => Container(
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(10),
@ -72,16 +79,16 @@ class CartOrderPage extends StatelessWidget {
child: Column(
children: [
...List.generate(
cart.shoppingCarts != null
? cart.shoppingCarts.length
model.cartResponse.shoppingCarts != null
? model.cartResponse.shoppingCarts.length
: 0,
(index) => ProductOrderItem(
cart.shoppingCarts[index], () {
print(cart.shoppingCarts[index]
model.cartResponse.shoppingCarts[index], () {
print(model.cartResponse.shoppingCarts[index]
.quantity);
model
.changeProductQuantity(
cart.shoppingCarts[index])
model.cartResponse.shoppingCarts[index])
.then((value) {
if (model.state !=
ViewState.Error) {
@ -97,7 +104,7 @@ class CartOrderPage extends StatelessWidget {
}, () {
model
.deleteProduct(
cart.shoppingCarts[index])
model.cartResponse.shoppingCarts[index])
.then((value) {
if (model.state !=
ViewState.Error) {
@ -127,7 +134,7 @@ class CartOrderPage extends StatelessWidget {
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(cart.subtotal).toStringAsFixed(2)}",
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
@ -152,7 +159,7 @@ class CartOrderPage extends StatelessWidget {
fontWeight: FontWeight.w500,
),
Texts(
"${TranslationBase.of(context).sar} ${(cart.subtotalVatAmount).toStringAsFixed(2)}",
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
@ -177,7 +184,7 @@ class CartOrderPage extends StatelessWidget {
fontWeight: FontWeight.bold,
),
Texts(
"${TranslationBase.of(context).sar} ${(cart.subtotal).toStringAsFixed(2)}",
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
@ -196,10 +203,9 @@ class CartOrderPage extends StatelessWidget {
width: mediaQuery.size.width - 20,
height: 30.0,
fit: BoxFit.scaleDown,
)
],
),
),
SizedBox(height: 120,)
],
),
),
),
@ -237,7 +243,6 @@ class CartOrderPage extends StatelessWidget {
child: OrderBottomWidget(model.addresses, height),
),
),
),
);
}
}
@ -258,12 +263,9 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
child: Consumer<ShoppingCartResponse>(
builder: (ctx, cart, _) => !(cart.shoppingCarts == null ||
cart.shoppingCarts.length == 0)
OrderPreviewViewModel cart = Provider.of(context);
return !(cart.cartResponse.shoppingCarts == null ||
cart.cartResponse.shoppingCarts.length == 0)
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -352,7 +354,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
child: Row(
children: [
Texts(
"${TranslationBase.of(context).sar} ${(cart.subtotal).toStringAsFixed(2)}",
"${TranslationBase.of(context).sar} ${(cart.cartResponse.subtotal).toStringAsFixed(2)}",
fontSize:
projectProvider.isArabic ? 12 : 14,
fontWeight: FontWeight.bold,
@ -371,7 +373,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
),
),
Texts(
"${cart.quantityCount} ${TranslationBase.of(context).items}",
"${cart.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
fontSize: 10,
color: Colors.grey,
fontWeight: FontWeight.bold,
@ -405,7 +407,6 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
),
],
)
: Container(),
));
: Container();
}
}

@ -15,26 +15,34 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.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';
class OrderPreviewPage extends StatelessWidget {
class OrderPreviewPage extends StatefulWidget {
final List<Addresses> addresses;
OrderPreviewPage(this.addresses);
@override
_OrderPreviewPageState createState() => _OrderPreviewPageState();
}
class _OrderPreviewPageState extends State<OrderPreviewPage> {
MyInAppBrowser browser;
@override
void initState() {
super.initState();
Provider.of<OrderPreviewViewModel>(context, listen: false).getShoppingCart();
}
@override
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
return BaseView<OrderPreviewViewModel>(
onModelReady: (model) => model.getShoppingCart(),
builder: (_, model, wi) => ChangeNotifierProvider.value(
value: model.paymentCheckoutData,
OrderPreviewViewModel model = Provider.of(context);
return NetworkBaseView(
child: AppScaffold(
appBarTitle: "${TranslationBase.of(context).checkOut}",
isShowAppBar: true,
@ -49,7 +57,7 @@ class OrderPreviewPage extends StatelessWidget {
color: Color(0xFFF1F1F1),
child: Column(
children: [
SelectAddressWidget(model, addresses),
SelectAddressWidget(model,widget.addresses),
SizedBox(
height: 10,
),
@ -252,7 +260,8 @@ class OrderPreviewPage extends StatelessWidget {
child: PaymentBottomWidget(model),
),
),
));
baseViewModel: model,
);
}
}

@ -1,5 +1,6 @@
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';
@ -35,6 +36,7 @@ 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 {
@ -50,10 +52,11 @@ class _PharmacyPageState extends State<PharmacyPage> {
onWillPop: ()async{
return false;
},
child: BaseView<PharmacyModuleViewModel>(
child:BaseView<PharmacyModuleViewModel>(
onModelReady: (model) async {
await model.getSavedLanguage();
await model.getBannerList();
await locator<OrderPreviewService>().getShoppingCart();
},
allowAny: true,
builder: (_, model, wi) => AppScaffold(
@ -74,8 +77,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
ShopByBrandWidget(),
RecentlyViewedWidget(),
BestSellerWidget(),
],
),
],),
),
),
),

@ -5,22 +5,16 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
class WishlistPage extends StatefulWidget {
bool showBar;
WishlistPage(this.showBar);
@override
_WishlistPageState createState() => _WishlistPageState();
}
class _WishlistPageState extends State<WishlistPage> {
bool isTrue = true;
class WishlistPage extends StatelessWidget {
const WishlistPage({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BaseView<WishListViewModel>(
onModelReady: (model) => model.getWishlistData(),
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).wishlist,
isShowAppBar: widget.showBar,
isShowAppBar: true,
isShowDecPage: false,
isPharmacy: true,
baseViewModel: model,
@ -57,10 +51,8 @@ class _WishlistPageState extends State<WishlistPage> {
flex: 20,
child: Container(
width: double.infinity,
height:
MediaQuery.of(context).size.height * 0.85, //250,
child:
ProductCheckTypeWidget(isTrue, model.wishListList),
height: MediaQuery.of(context).size.height * 0.85, //250,
child: ProductCheckTypeWidget(model: model,),
),
),
],
@ -70,3 +62,4 @@ class _WishlistPageState extends State<WishlistPage> {
);
}
}

@ -19,10 +19,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/my_account_items.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/my_account_services.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -111,10 +108,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Container(
child: Row(
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(
horizontal: 15.0, vertical: 8.0),
child: Container(
Container(
padding: EdgeInsets.only(
top: 20.0,
left: 10.0,
@ -122,42 +116,36 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
bottom: 10.0,
),
child: LargeAvatar(
radius: 55.0,
name: user.firstName.toString(),
url:
'https://thumbs.dreamstime.com/b/default-avatar-profile-vector-user-profile-default-avatar-profile-vector-user-profile-profile-179376714.jpg',
),
url: '',
),
),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Column(children: <Widget>[
Row(children: <Widget>[
Texts(
Text(
TranslationBase.of(context)
.welcome,
fontSize: 16.0,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold,
color: Colors.grey),
),
]),
SizedBox(
height: 5.0,
height: 10,
),
Row(children: <Widget>[
Texts(
Text(
languageID == "ar"
? user.firstNameN
.toString() +
? user.firstNameN.toString() +
" " +
user.lastNameN
.toString()
: user.firstName
.toString() +
user.lastNameN.toString()
: user.firstName.toString() +
" " +
user.lastName
.toString(),
fontSize: 17.0,
fontWeight: FontWeight.bold,
user.lastName.toString(),
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold),
),
]),
]),
@ -180,10 +168,8 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Container(
child: Row(
children: <Widget>[
AccountServices(
title: TranslationBase.of(context).orders,
serviceImage:
'assets/images/pharmacy/orders_icon.svg',
Expanded(
child: InkWell(
onTap: () {
if (customerId == null) {
AppToast.showErrorToast(
@ -196,37 +182,109 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
page: OrderPage(
customerID: customerId)));
},
child: Column(
children: <Widget>[
// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')),
SvgPicture.asset(
'assets/images/pharmacy/orders_icon.svg',
width: 50,
height: 50,
),
AccountServices(
title: TranslationBase.of(context).lakum,
serviceImage:
'assets/images/pharmacy/lakum_icon.svg',
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).orders,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: LakumMainPage()));
},
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/lakum_icon.svg',
width: 50,
height: 50,
),
AccountServices(
title: TranslationBase.of(context).wishlist,
serviceImage:
'assets/images/pharmacy/wishlist_icon.svg',
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).lakum,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold),
),
],
),
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
WishlistPage(true)));
FadePage(page: WishlistPage()));
},
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/wishlist_icon.svg',
width: 50,
height: 50,
),
AccountServices(
title: TranslationBase.of(context).reviews,
serviceImage:
'assets/images/pharmacy/review_icon.svg',
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).wishlist,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyReviewsPage()));
},
)
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/review_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).reviews,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
],
)),
SizedBox(
@ -243,13 +301,16 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
height: 10,
),
Container(
padding: EdgeInsets.symmetric(horizontal: 25.0),
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(TranslationBase.of(context).myAccount,
Text(
TranslationBase.of(context).myAccount,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
),
@ -264,11 +325,24 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
FadePage(
page: HomePrescriptionsPage()));
},
child: AccountItem(
title: TranslationBase.of(context)
.myPrescription,
itemIcon:
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/my_prescription_icon.svg',
width: 28,
height: 28,
),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context)
.myPrescription,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
@ -283,12 +357,24 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push(context,
FadePage(page: ComparePage()));
},
child: AccountItem(
isTerms: true,
title: TranslationBase.of(context)
.compare,
itemIcon:
"assets/images/pharmacy/compare.png")),
child: Row(
children: <Widget>[
Image.asset(
'assets/images/pharmacy/compare.png',
width: 35,
height: 35),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context).compare,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
height: 5,
),
@ -303,11 +389,25 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
FadePage(
page: HomePrescriptionsPage()));
},
child: AccountItem(
title: TranslationBase.of(context)
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/medication_refill_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context)
.medicationsRefill,
itemIcon:
'assets/images/pharmacy/medication_refill_icon.svg'),
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
height: 5,
@ -321,10 +421,23 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push(
context, FadePage(page: MyFamily()));
},
child: AccountItem(
title: TranslationBase.of(context).family,
itemIcon:
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/my_family_icon.svg',
width: 20,
height: 20,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).family,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
@ -341,11 +454,24 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
FadePage(
page: PharmacyAddressesPage()));
},
child: AccountItem(
itemIcon:
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/shipping_addresses_icon.svg',
title: TranslationBase.of(context)
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context)
.shippingAddresses,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
@ -360,15 +486,28 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push(
context,
FadePage(
page:
PharmacyTermsConditions()));
page: PharmacyTermsConditions()));
},
child: AccountItem(
isTerms: true,
title: TranslationBase.of(context)
child: Row(
children: <Widget>[
Image.asset(
'assets/images/pharmacy/terms.png',
width: 25,
height: 25,
),
SizedBox(
width: 10,
),
Text(
TranslationBase.of(context)
.conditionsHMG,
itemIcon:
'assets/images/pharmacy/terms.png')),
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
height: 5,
),
@ -388,13 +527,28 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
this.mobileNo,
this.languageId)));
},
child: AccountItem(
title: TranslationBase.of(context)
.conditions,
itemIcon:
child: Row(
children: <Widget>[
Image.asset(
'assets/images/pharmacy/terms.png',
isTerms: true,
)),
width: 25,
height: 25,
),
// IconButton(icon: Icon(Icons.error_outline), iconSize: 30,
// color: Colors.black,),
SizedBox(
width: 10,
),
Text(
TranslationBase.of(context)
.conditions,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
],
),
),
@ -411,17 +565,17 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 15.0, vertical: 8.0),
child: Container(
Container(
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(TranslationBase.of(context).reachUs,
Text(
TranslationBase.of(context).reachUs,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 5,
),
@ -434,11 +588,22 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push(context,
FadePage(page: LiveChatPage()));
},
child: AccountItem(
title: TranslationBase.of(context)
.contactUs,
itemIcon:
'assets/images/pharmacy/contact_us_icon.svg'),
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/contact_us_icon.svg',
width: 20,
height: 20,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).contactUs,
style: TextStyle(fontSize: 13.0),
),
],
),
),
SizedBox(
height: 5,
@ -452,13 +617,25 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push(context,
FadePage(page: FindUsPage()));
},
child: AccountItem(
title: TranslationBase.of(context)
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/our_locations_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context)
.ourLocations,
itemIcon:
'assets/images/pharmacy/our_locations_icon.svg'))
style: TextStyle(fontSize: 13.0),
),
],
),
)
],
),
)
],

@ -25,10 +25,17 @@ class _GestureIconButtonState extends State<GestureIconButton> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onLongPressStart: (_) =>
setState(() => _buttonLongPress = !_buttonLongPress),
onLongPressEnd: (_) =>
setState(() => _buttonLongPress = !_buttonLongPress),
onTap: (){
setState(() {
_buttonLongPress = !_buttonLongPress;
});
widget.onTap();
},
// onLongPressStart: (_) =>
// setState(() => _buttonLongPress = !_buttonLongPress),
// onLongPressEnd: (_) =>
// setState(() => _buttonLongPress = !_buttonLongPress),
child: Container(
decoration: BoxDecoration(
border: Border.all(
@ -52,6 +59,8 @@ class _GestureIconButtonState extends State<GestureIconButton> {
),
Texts(
widget.label,
fontWeight: FontWeight.bold,
fontSize: 13.6,
color: _buttonLongPress ? Colors.white : Colors.black,
),
],

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/Constants.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.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';
@ -6,6 +9,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../locator.dart';
class BottomNavPharmacyItem extends StatelessWidget {
final String title;
final IconData icon;
@ -32,7 +37,10 @@ class BottomNavPharmacyItem extends StatelessWidget {
return Expanded(
child: SizedBox(
// height: 72.0,
child: Material(
child: Stack(
clipBehavior: Clip.none,
children: [
Material(
type: MaterialType.transparency,
child: InkWell(
highlightColor: Colors.transparent,
@ -89,6 +97,22 @@ class BottomNavPharmacyItem extends StatelessWidget {
),
),
),
if(currentIndex == 3 &&Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount !=0)
Positioned(
top: 5, right: -3.5,
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<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount.toString(), style: "caption", medium: true, color: Colors.white,)),
),
)
],
),
),
);
}

Loading…
Cancel
Save