|
|
|
|
@ -22,7 +22,7 @@ class ProductNameAndPrice extends StatefulWidget {
|
|
|
|
|
final Function deleteFromWishlistFunction;
|
|
|
|
|
|
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
|
|
|
|
|
|
ProductNameAndPrice(this.context, this.item,
|
|
|
|
|
{this.customerId,
|
|
|
|
|
@ -64,50 +64,52 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
|
|
|
|
|
: Colors.green,
|
|
|
|
|
),
|
|
|
|
|
// SizedBox(width: 20),
|
|
|
|
|
if(widget.authenticatedUserObject.isLogin)
|
|
|
|
|
widget.item.stockAvailability == 'Out of stock' &&
|
|
|
|
|
widget.customerId != null
|
|
|
|
|
? InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
widget.notifyMeWhenAvailable(context, widget.item.id),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).notifyMe,
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 4),
|
|
|
|
|
Icon(
|
|
|
|
|
FontAwesomeIcons.bell,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
size: 15.0,
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
)
|
|
|
|
|
: IconWithBg(
|
|
|
|
|
icon: !widget.isInWishList
|
|
|
|
|
? Icons.favorite_border
|
|
|
|
|
: Icons.favorite,
|
|
|
|
|
color: !widget.isInWishList ? Colors.white : Colors.red,
|
|
|
|
|
onPress: () async {
|
|
|
|
|
{
|
|
|
|
|
if (widget.customerId != null) {
|
|
|
|
|
if (!widget.isInWishList) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await widget
|
|
|
|
|
.addToWishlistFunction(widget.item.id);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (widget.authenticatedUserObject.isLogin)
|
|
|
|
|
widget.item.stockAvailability == 'Out of stock' &&
|
|
|
|
|
widget.customerId != null
|
|
|
|
|
? InkWell(
|
|
|
|
|
onTap: () => widget.notifyMeWhenAvailable(
|
|
|
|
|
context, widget.item.id),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).notifyMe,
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 4),
|
|
|
|
|
Icon(
|
|
|
|
|
FontAwesomeIcons.bell,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
size: 15.0,
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
)
|
|
|
|
|
: IconWithBg(
|
|
|
|
|
icon: !widget.isInWishList
|
|
|
|
|
? Icons.favorite_border
|
|
|
|
|
: Icons.favorite,
|
|
|
|
|
color: !widget.isInWishList
|
|
|
|
|
? Colors.white
|
|
|
|
|
: Colors.red[800],
|
|
|
|
|
onPress: () async {
|
|
|
|
|
{
|
|
|
|
|
if (widget.customerId != null) {
|
|
|
|
|
if (!widget.isInWishList) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await widget
|
|
|
|
|
.addToWishlistFunction(widget.item.id);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
} else {
|
|
|
|
|
await widget
|
|
|
|
|
.deleteFromWishlistFunction(widget.item.id);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
await widget
|
|
|
|
|
.deleteFromWishlistFunction(widget.item.id);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return;
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -163,29 +165,32 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
|
|
|
|
|
"(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 70,
|
|
|
|
|
),
|
|
|
|
|
if (widget.item.rxMessage != null)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
? widget.item.rxMessagen.toString()
|
|
|
|
|
: widget.item.rxMessage.toString(),
|
|
|
|
|
style: TextStyle(color: Colors.red, fontSize: 10),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 5,
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
FontAwesomeIcons.questionCircle,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
size: 15.0,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: widget.item.rxMessage != null
|
|
|
|
|
? Text(
|
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
? widget.item.rxMessagen.toString()
|
|
|
|
|
: widget.item.rxMessage.toString(),
|
|
|
|
|
style: TextStyle(color: Colors.red, fontSize: 10),
|
|
|
|
|
)
|
|
|
|
|
: Container()),
|
|
|
|
|
),
|
|
|
|
|
widget.item.rxMessage != null
|
|
|
|
|
? Icon(
|
|
|
|
|
FontAwesomeIcons.questionCircle,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
size: 15.0,
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|