Merge branch 'Fatima-New-Design' into 'development_new_design_2.0'

Fatima new design

See merge request Cloud_Solution/diplomatic-quarter!543
merge-requests/531/merge
haroon amjad 3 years ago
commit 003375b12f

@ -93,6 +93,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
isShowDecPage: false, isShowDecPage: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
height: MediaQuery.of(context).size.height * 5.87, height: MediaQuery.of(context).size.height * 5.87,
@ -485,7 +487,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
color: CustomColors.green, color: CustomColors.green,
), ),
onPressed: () async { onPressed: () async {
if (model.finalProducts[index].rxMessage == null) { if (model.finalProducts[index].isRx == false) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.finalProducts[index].id); await addToCartFunction(1, model.finalProducts[index].id);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -93,6 +93,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
isShowDecPage: false, isShowDecPage: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
baseViewModel: model, baseViewModel: model,
body: SmartRefresher( body: SmartRefresher(
enablePullDown: false, enablePullDown: false,
@ -1271,8 +1273,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
), ),
onPressed: onPressed:
() async { () async {
if (model.parentProducts[index].rxMessage == if (model.parentProducts[index].isRx == false) {
null) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, await addToCartFunction(1,
model.parentProducts[index].id); model.parentProducts[index].id);

@ -37,6 +37,7 @@ class _ProductCheckTypeWidgetState extends State<ProductCheckTypeWidget> {
productImage: widget.model.wishListList[index].product.images[0].src, productImage: widget.model.wishListList[index].product.images[0].src,
productID: widget.model.wishListList[index].product.id, productID: widget.model.wishListList[index].product.id,
onDelete: deleteWishListItem, onDelete: deleteWishListItem,
isRx:widget.model.wishListList[index].product.isRx,
), ),
), ),

@ -33,6 +33,9 @@ class _ComparePageState extends State<ComparePage> {
appBarTitle: TranslationBase.of(context).compare, appBarTitle: TranslationBase.of(context).compare,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isBottomBar: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: compareList(), child: compareList(),

@ -26,6 +26,9 @@ class _MyReviewsPageState extends State<MyReviewsPage> {
appBarTitle: TranslationBase.of(context).reviews, appBarTitle: TranslationBase.of(context).reviews,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isBottomBar: true,
baseViewModel: model, baseViewModel: model,
body: model.reviewListList.length == 0 body: model.reviewListList.length == 0
? Container( ? Container(

@ -76,9 +76,14 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icons.shopping_cart, icon: Icons.shopping_cart,
color: Colors.grey[800], color: Colors.grey[800],
onPress: () { onPress: () {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 3)), (Route<dynamic> r) => false); locator<NavigationService>()
.navigatorKey
.currentContext,
MaterialPageRoute(
builder: (context) =>
LandingPagePharmacy(currentTab: 3)),
(Route<dynamic> r) => false);
// Navigator.push( // Navigator.push(
// context, // context,
// MaterialPageRoute(builder: (context) => CartOrderPage()), // MaterialPageRoute(builder: (context) => CartOrderPage()),
@ -144,7 +149,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
return Container( return Container(
child: new Wrap( child: new Wrap(
children: <Widget>[ children: <Widget>[
if (product.stockAvailability != 'Out of stock') if (product.stockAvailability != 'Out of stock' && product.isRx != true)
new ListTile( new ListTile(
leading: Icon(Icons.shopping_cart), leading: Icon(Icons.shopping_cart),
title: Text( title: Text(
@ -161,9 +166,10 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).addQuantity AppToast.showErrorToast(
// "you should add quantity" message: TranslationBase.of(context).addQuantity
); // "you should add quantity"
);
} }
}), }),
ListTile( ListTile(
@ -190,7 +196,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
), ),
onTap: () { onTap: () {
Provider.of<CompareList>(context, listen: false) Provider.of<CompareList>(context, listen: false)
.addItem(specificationData,context); .addItem(specificationData, context);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
), ),

@ -252,7 +252,7 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
} }
_quantityController.text = "${widget.item.quantity}"; _quantityController.text = "${widget.item.quantity}";
_totalPrice = _totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}"; "${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}";
} }
}); });
} }

@ -17,6 +17,9 @@ class WishlistPage extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isBottomBar: true,
baseViewModel: model, baseViewModel: model,
body: model.wishListList.length == 0 body: model.wishListList.length == 0
? Container( ? Container(
@ -35,8 +38,8 @@ class WishlistPage extends StatelessWidget {
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(TranslationBase.of(context).noData,
'There is no data', // 'There is no data',
style: TextStyle(fontSize: 30), style: TextStyle(fontSize: 30),
), ),
) )

@ -66,6 +66,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isBottomBar: true,
body: Container( body: Container(
child: Column( child: Column(
children: [ children: [

@ -84,6 +84,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
appBarTitle: TranslationBase.of(context).orderDetail, appBarTitle: TranslationBase.of(context).orderDetail,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isBottomBar: true,
baseViewModel: model, baseViewModel: model,
body: model.orderListModel.length > 0 body: model.orderListModel.length > 0
? Container( ? Container(

@ -108,10 +108,10 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount, appBarTitle: TranslationBase.of(context).myAccount,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: true, isShowDecPage: false,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
//isBottomBar: true, showHomeAppBarIcon: false,
isMainPharmacyPages: true, isMainPharmacyPages: true,
body: user != null body: user != null
? Container( ? Container(

@ -40,11 +40,13 @@ class _SubCategoriseModalsheetState extends State<SubCategoriseModalsheet> {
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
// appBarTitle: titleName, // appBarTitle: titleName,
appBarTitle: TranslationBase.of(context).categorise, appBarTitle: TranslationBase.of(context).categorise,
isBottomBar: false, isBottomBar: true,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
isShowDecPage: false, isShowDecPage: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
color: Colors.white, color: Colors.white,
@ -77,7 +79,11 @@ class _SubCategoriseModalsheetState extends State<SubCategoriseModalsheet> {
context, context,
FadePage( FadePage(
page: SubCategorisePage( page: SubCategorisePage(
title: model.categoriseParent[index].name, title: projectViewModel
.isArabic
? model.categoriseParent[index].namen
: model.categoriseParent[index].name,
// title: model.categoriseParent[index].name,
id: model.categoriseParent[index].id, id: model.categoriseParent[index].id,
parentId: id, parentId: id,
)), )),

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/entity_checkbox_list.dart'; import 'package:diplomaticquarterapp/widgets/others/entity_checkbox_list.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -76,12 +77,15 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
allowAny: true, allowAny: true,
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model,
Widget child) => Widget child) =>
PharmacyAppScaffold( AppScaffold(
isPharmacy: true,
appBarTitle: title, appBarTitle: title,
isBottomBar: false, isBottomBar: true,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
isShowDecPage: false, isShowDecPage: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
baseViewModel: model, baseViewModel: model,
body: SmartRefresher( body: SmartRefresher(
controller: controller, controller: controller,
@ -1219,8 +1223,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
if (model if (model
.subProducts[ .subProducts[
index] index]
.rxMessage == .isRx == false) {
null) {
GifLoaderDialogUtils GifLoaderDialogUtils
.showMyDialog( .showMyDialog(
context); context);

@ -1,13 +1,16 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_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/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class productTile extends StatelessWidget { class productTile extends StatelessWidget {
@ -27,6 +30,7 @@ class productTile extends StatelessWidget {
final dynamic productID; final dynamic productID;
final Function onDelete; final Function onDelete;
final dynamic approvedTotalReviews; final dynamic approvedTotalReviews;
final dynamic isRx;
// final VoidCallback deleteWishlistItems; // final VoidCallback deleteWishlistItems;
@ -47,10 +51,12 @@ class productTile extends StatelessWidget {
this.productID, this.productID,
this.onDelete, this.onDelete,
this.approvedTotalReviews, this.approvedTotalReviews,
this.isRx
}); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
height: 180, height: 180,
width: double.infinity, width: double.infinity,
@ -87,7 +93,16 @@ class productTile extends StatelessWidget {
children: [ children: [
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel
.isArabic ? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: productName,
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
),
),
): Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
@ -99,7 +114,17 @@ class productTile extends StatelessWidget {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel
.isArabic ? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: 'SAR $productPrice',
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
),
),
)
:Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
@ -163,10 +188,14 @@ class productTile extends StatelessWidget {
color: Colors.green, color: Colors.green,
), ),
onPressed: () async { onPressed: () async {
if(isRx == false){
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, productID, context); await addToCartFunction(1, productID, context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Utils.navigateToCartPage(); Utils.navigateToCartPage();}
else {
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
}
}, },
), ),
], ],

Loading…
Cancel
Save