|
|
@ -45,7 +45,6 @@ class __ProductDetailPageState extends State<ProductDetailPage>{
|
|
|
|
bool isInWishList = false;
|
|
|
|
bool isInWishList = false;
|
|
|
|
int quantity = 0;
|
|
|
|
int quantity = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkWishlist() async {
|
|
|
|
checkWishlist() async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
ProductDetailViewModel model = new ProductDetailViewModel();
|
|
|
|
ProductDetailViewModel model = new ProductDetailViewModel();
|
|
|
@ -96,11 +95,15 @@ class __ProductDetailPageState extends State<ProductDetailPage>{
|
|
|
|
isShowDecPage: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
customAppBar: ProductAppBar(
|
|
|
|
customAppBar: ProductAppBar(
|
|
|
|
product: widget.product,
|
|
|
|
product: widget.product,
|
|
|
|
|
|
|
|
quantity: quantity,
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
addToWishlistFunction: (item) {
|
|
|
|
addToWishlistFunction: () async {
|
|
|
|
addToWishlistFunction(itemID:item,model:model);
|
|
|
|
await addToWishlistFunction(itemID: itemID, model: model);
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
|
|
|
|
deleteFromWishlistFunction: () async {
|
|
|
|
|
|
|
|
await deleteFromWishlistFunction(itemID: itemID, model: model);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
isInWishList:isInWishList
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
@ -137,11 +140,15 @@ class __ProductDetailPageState extends State<ProductDetailPage>{
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
deleteFromWishlistFunction: (item) {
|
|
|
|
deleteFromWishlistFunction: (item) {
|
|
|
|
deleteFromWishlistFunction(itemID: item, model: model);
|
|
|
|
deleteFromWishlistFunction(
|
|
|
|
|
|
|
|
itemID: item, model: model);
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
notifyMeWhenAvailable: (context, itemId) {
|
|
|
|
notifyMeWhenAvailable: (context, itemId) {
|
|
|
|
notifyMeWhenAvailable(itemId:itemId, customerId: customerId, model: model);
|
|
|
|
notifyMeWhenAvailable(
|
|
|
|
|
|
|
|
itemId: itemId,
|
|
|
|
|
|
|
|
customerId: customerId,
|
|
|
|
|
|
|
|
model: model);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isInWishList: isInWishList,
|
|
|
|
isInWishList: isInWishList,
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -214,12 +221,16 @@ class __ProductDetailPageState extends State<ProductDetailPage>{
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
FlatButton(
|
|
|
|
FlatButton(
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
if(widget.product.approvedTotalReviews>0) {
|
|
|
|
if (widget.product.approvedTotalReviews >
|
|
|
|
|
|
|
|
0) {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
context);
|
|
|
|
context);
|
|
|
|
await model.getProductReviewsData(
|
|
|
|
await model.getProductReviewsData(
|
|
|
|
widget.product.id);
|
|
|
|
widget.product.id);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
model.clearReview();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isDetails = false;
|
|
|
|
isDetails = false;
|
|
|
@ -319,21 +330,27 @@ class __ProductDetailPageState extends State<ProductDetailPage>{
|
|
|
|
addToWishlistFunction({itemID, ProductDetailViewModel model}) async {
|
|
|
|
addToWishlistFunction({itemID, ProductDetailViewModel model}) async {
|
|
|
|
isInWishList = true;
|
|
|
|
isInWishList = true;
|
|
|
|
await model.addToWishlistData(itemID);
|
|
|
|
await model.addToWishlistData(itemID);
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
deleteFromWishlistFunction({itemID, ProductDetailViewModel model}) async {
|
|
|
|
deleteFromWishlistFunction({itemID, ProductDetailViewModel model}) async {
|
|
|
|
isInWishList = false;
|
|
|
|
isInWishList = false;
|
|
|
|
await model.deletWishlistData(itemID);
|
|
|
|
await model.deleteWishlistData(itemID);
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addToCartFunction(
|
|
|
|
addToCartFunction({quantity, itemID, BuildContext context,ProductDetailViewModel model}) async {
|
|
|
|
{quantity,
|
|
|
|
|
|
|
|
itemID,
|
|
|
|
|
|
|
|
BuildContext context,
|
|
|
|
|
|
|
|
ProductDetailViewModel model}) async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await model.addToCartData(quantity, itemID);
|
|
|
|
await model.addToCartData(quantity, itemID);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
notifyMeWhenAvailable({itemId, customerId,ProductDetailViewModel model }) async {
|
|
|
|
notifyMeWhenAvailable(
|
|
|
|
|
|
|
|
{itemId, customerId, ProductDetailViewModel model}) async {
|
|
|
|
await model.notifyMe(customerId, itemId);
|
|
|
|
await model.notifyMe(customerId, itemId);
|
|
|
|
}
|
|
|
|
}
|