Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into hussam_pharmacy_fix

 Conflicts:
	lib/pages/sub_categorise_page.dart
merge-requests/511/head
hussam al-habibeh 4 years ago
commit 80c6be239e

@ -636,7 +636,7 @@ const Map localizedValues = {
"compareListFull": {"en": "Your compare list is full", "ar": "قائمة المقارنة ممتلئه"},
"addQuantity": {"en": "You should add quantity", "ar": "اختر الكمية"},
"addToCartMsg": {"en": "You have added a product to the cart", "ar": "تمت اضافة المنتج بنجاح"},
"addToWishlistMsg": {"en": "You have added a product to the Wishlist", "ar": "تمت الاضافة لقائمة الرغبات"},
"addToWishlistMsg": {"en": "You have added a product to the Wishlist", "ar": "تمت الاضافة لقائمة المفضله"},
"notifyMeMsg": {"en": "You will be notified when product available", "ar": "سيتم اخبارك في حال توفر المنتج"},
"removeFromWishlistMsg": {"en": "You have removed a product from the Wishlist", "ar": "تمت ازالة المنتج بنجاح"},
"min": {"en": "Min", "ar": "اقل"},

@ -46,10 +46,10 @@ class ProductDetailViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProductLocationData() async {
Future getProductLocationData(String productSKU) async {
hasError = false;
setState(ViewState.BusyLocal);
await _productDetailService.getProductAvailabiltyDetail();
await _productDetailService.getProductAvailabiltyDetail(productSKU);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);

@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.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/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart';
@ -15,8 +14,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -111,8 +108,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
await addToWishlistFunction(itemID: itemID, model: model);
},
deleteFromWishlistFunction: () async {
await deleteFromWishlistFunction(
itemID: itemID, model: model);
await deleteFromWishlistFunction(itemID: itemID, model: model);
},
isInWishList: isInWishList,
addToCartFunction: addToCartFunction,
@ -133,8 +129,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
fit: BoxFit.contain,
),
),
if (widget.product.discountDescription != null)
DiscountDescription(product: widget.product)
if (widget.product.discountDescription != null) DiscountDescription(product: widget.product)
],
),
),
@ -152,21 +147,15 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
setState(() {});
},
deleteFromWishlistFunction: (item) {
deleteFromWishlistFunction(
itemID: item, model: model);
deleteFromWishlistFunction(itemID: item, model: model);
setState(() {});
},
notifyMeWhenAvailable: (context, itemId) {
notifyMeWhenAvailable(
itemId: itemId,
customerId: customerId,
model: model);
notifyMeWhenAvailable(itemId: itemId, customerId: customerId, model: model);
},
isInWishList: isInWishList,
isStockAvailable: model.isStockAvailable,
stockAvailability: projectViewModel.isArabic
? model.stockAvailabilityn
: model.stockAvailability,
stockAvailability: projectViewModel.isArabic ? model.stockAvailabilityn : model.stockAvailability,
),
),
SizedBox(
@ -179,8 +168,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(
vertical: 15, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
child: Texts(
TranslationBase.of(context).specification,
fontSize: 15,
@ -217,16 +205,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
},
child: Text(
TranslationBase.of(context).details,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
color: Colors.white,
),
CustomDivider(
color: isDetails
? Colors.green
: Colors.transparent,
color: isDetails ? Colors.green : Colors.transparent,
)
],
),
@ -237,14 +221,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
children: [
FlatButton(
onPressed: () async {
if (widget.product.approvedTotalReviews >
0) {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getProductReviewsData(
widget.product.id);
GifLoaderDialogUtils.hideDialog(
context);
if (widget.product.approvedTotalReviews > 0) {
GifLoaderDialogUtils.showMyDialog(context);
await model.getProductReviewsData(widget.product.id);
GifLoaderDialogUtils.hideDialog(context);
} else {
model.clearReview();
}
@ -256,16 +236,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
},
child: Text(
TranslationBase.of(context).reviews,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
color: Colors.white,
),
CustomDivider(
color: isReviews
? Colors.green
: Colors.transparent,
color: isReviews ? Colors.green : Colors.transparent,
),
],
),
@ -276,9 +252,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
children: [
FlatButton(
onPressed: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getProductLocationData();
GifLoaderDialogUtils.showMyDialog(context);
await model.getProductLocationData(widget.product.sku);
GifLoaderDialogUtils.hideDialog(context);
setState(() {
@ -289,16 +264,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
},
child: Text(
TranslationBase.of(context).availability,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
color: Colors.white,
),
CustomDivider(
color: isAvailability
? Colors.green
: Colors.transparent,
color: isAvailability ? Colors.green : Colors.transparent,
),
],
),
@ -327,24 +298,22 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
SizedBox(
height: 10,
),
RecommendedProducts(
product: widget.product,
productDetailViewModel: model,
addToWishlistFunction: (itemID) async {
await addToWishlistFunction(
itemID: itemID, model: model);
},
deleteFromWishlistFunction: (itemID) async {
await deleteFromWishlistFunction(
itemID: itemID, model: model);
},
)
if (projectViewModel.isLogin)
RecommendedProducts(
product: widget.product,
productDetailViewModel: model,
addToWishlistFunction: (itemID) async {
await addToWishlistFunction(itemID: itemID, model: model);
},
deleteFromWishlistFunction: (itemID) async {
await deleteFromWishlistFunction(itemID: itemID, model: model);
},
)
],
),
),
// : AppCircularProgressIndicator(),
bottomSheet: model.state == ViewState.Idle ||
model.state == ViewState.ErrorLocal
bottomSheet: model.state == ViewState.Idle || model.state == ViewState.ErrorLocal
? FooterWidget(
model.isStockAvailable,
widget.product.orderMaximumQuantity,
@ -361,8 +330,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
));
}
addToShoppingCartFunction(
{quantity, itemID, ProductDetailViewModel model}) async {
addToShoppingCartFunction({quantity, itemID, ProductDetailViewModel model}) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.addToCartData(quantity, itemID, context);
GifLoaderDialogUtils.hideDialog(context);
@ -392,7 +360,6 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}
}
notifyMeWhenAvailable(
{itemId, customerId, ProductDetailViewModel model, context}) async {
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model, context}) async {
await model.notifyMe(customerId, itemId, context);
}

@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -13,7 +12,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/entity_checkbox_list.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
@ -30,14 +28,12 @@ class SubCategorisePage extends StatefulWidget {
String title;
String parentId;
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
SubCategorisePage({this.id, this.parentId, this.title});
@override
_SubCategorisePageState createState() =>
_SubCategorisePageState(id: id, title: title, parentId: parentId);
_SubCategorisePageState createState() => _SubCategorisePageState(id: id, title: title, parentId: parentId);
}
class _SubCategorisePageState extends State<SubCategorisePage> {
@ -72,6 +68,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
builder: (BuildContext context, PharmacyCategoriseViewModel model,
Widget child) =>
PharmacyAppScaffold(
builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => PharmacyAppScaffold(
appBarTitle: title,
isBottomBar: false,
isShowAppBar: true,
@ -293,24 +290,24 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
),
),
Divider(
thickness: 1.0,
color: Colors.grey.shade400,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Row(
children: [
Icon(Icons.wrap_text),
SizedBox(
width: 10.0,
),
Texts(
TranslationBase.of(context).refine,
Divider(
thickness: 1.0,
color: Colors.grey.shade400,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Row(
children: [
Icon(Icons.wrap_text),
SizedBox(
width: 10.0,
),
Texts(
TranslationBase.of(context).refine,
// 'Refine',
fontWeight: FontWeight.w600,
),
@ -592,8 +589,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
"";
for (CategoriseParentModel category
in entityList) {
if (categoriesId ==
"") {
if (categoriesId =="") {
categoriesId =
category.id;
} else {
@ -602,12 +599,12 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
}
}
String
brandIds =
"";
brandIds ="";
for (CategoriseParentModel brand
in entityListBrands) {
if (brandIds ==
"") {
if (brandIds =="") {
brandIds =
brand.id;
} else {
@ -1270,8 +1267,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
}
bool isEntityListSelected(CategoriseParentModel masterKey) {
Iterable<CategoriseParentModel> history =
entityList.where((element) => masterKey.id == element.id);
Iterable<CategoriseParentModel> history = entityList.where((element) => masterKey.id == element.id);
if (history.length > 0) {
return true;
}
@ -1279,8 +1275,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
}
bool isEntityListSelectedBrands(CategoriseParentModel masterKey) {
Iterable<CategoriseParentModel> history =
entityListBrands.where((element) => masterKey.id == element.id);
Iterable<CategoriseParentModel> history = entityListBrands.where((element) => masterKey.id == element.id);
if (history.length > 0) {
return true;
}

@ -66,7 +66,7 @@ class ProductDetailService extends BaseService {
});
}
Future getProductAvailabiltyDetail() async {
Future getProductAvailabiltyDetail(String productSKU) async {
hasError = false;
Map<String, dynamic> request;
@ -76,7 +76,7 @@ class ProductDetailService extends BaseService {
// "IPAdress": "10.20.10.20",
// "LanguageID": 2,
// "PatientOutSA": 0,
// "SKU": "6720020025",
"SKU": productSKU,
// "SessionID": null,
// "VersionID": 5.6,
// "generalid": "Cs2020@2016\$2958",

Loading…
Cancel
Save