|
|
@ -231,37 +231,21 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
Stack(children: [
|
|
|
|
Stack(children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Align(
|
|
|
|
child: Align(
|
|
|
|
alignment:
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
Alignment
|
|
|
|
child: itemID.contains(e.id)
|
|
|
|
.topRight,
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
itemID.contains(e.id)
|
|
|
|
|
|
|
|
// !isInWishlist
|
|
|
|
// !isInWishlist
|
|
|
|
? IconButton(
|
|
|
|
? IconButton(icon: Icon(Icons.favorite_border),
|
|
|
|
icon:
|
|
|
|
color: Colors.grey, iconSize: 30,
|
|
|
|
Icon(Icons.favorite_border),
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
Colors.grey,
|
|
|
|
|
|
|
|
iconSize:
|
|
|
|
|
|
|
|
30,
|
|
|
|
|
|
|
|
onPressed:
|
|
|
|
onPressed:
|
|
|
|
() {
|
|
|
|
() {
|
|
|
|
setState(() {
|
|
|
|
setState(() {addToWishlistFunction(itemID);
|
|
|
|
addToWishlistFunction(itemID);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
:
|
|
|
|
: IconButton(icon: Icon(Icons.favorite),
|
|
|
|
IconButton(
|
|
|
|
color: Colors.red, iconSize: 30,
|
|
|
|
icon:
|
|
|
|
|
|
|
|
Icon(Icons.favorite),
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
Colors.red,
|
|
|
|
|
|
|
|
iconSize:
|
|
|
|
|
|
|
|
30,
|
|
|
|
|
|
|
|
onPressed:
|
|
|
|
onPressed:
|
|
|
|
() {
|
|
|
|
() {setState(() {
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
deleteFromWishlistFunction(itemID);
|
|
|
|
deleteFromWishlistFunction(itemID);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -269,149 +253,74 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
//
|
|
|
|
//
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
|
|
|
|
margin: EdgeInsets
|
|
|
|
alignment: Alignment.center,
|
|
|
|
.fromLTRB(0, 16,
|
|
|
|
|
|
|
|
10, 16),
|
|
|
|
|
|
|
|
alignment:
|
|
|
|
|
|
|
|
Alignment.center,
|
|
|
|
|
|
|
|
// padding: EdgeInsets.only(left: 25, bottom: 20),
|
|
|
|
// padding: EdgeInsets.only(left: 25, bottom: 20),
|
|
|
|
child: (e.images !=
|
|
|
|
child: (e.images != null && e.images.length > 0)
|
|
|
|
null &&
|
|
|
|
? Image.network(e.images[0].src.toString(),
|
|
|
|
e.images.length >
|
|
|
|
|
|
|
|
0)
|
|
|
|
|
|
|
|
? Image.network(
|
|
|
|
|
|
|
|
e.images[0]
|
|
|
|
|
|
|
|
.src
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
|
|
|
|
// item.images[0].src,
|
|
|
|
// item.images[0].src,
|
|
|
|
fit: BoxFit
|
|
|
|
fit: BoxFit.cover, height: 60,)
|
|
|
|
.cover,
|
|
|
|
: Image.asset("assets/images/no_image.png", fit: BoxFit.cover, height: 60,
|
|
|
|
height: 60,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: Image.asset(
|
|
|
|
|
|
|
|
"assets/images/no_image.png",
|
|
|
|
|
|
|
|
fit: BoxFit
|
|
|
|
|
|
|
|
.cover,
|
|
|
|
|
|
|
|
height: 60,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(width: e.rxMessage != null ? MediaQuery.of(context)
|
|
|
|
width: e.rxMessage !=
|
|
|
|
.size.width / 5 : 0,
|
|
|
|
null
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
? MediaQuery.of(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
context)
|
|
|
|
color: Color(0xffb23838),
|
|
|
|
.size
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
.width /
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
: 0,
|
|
|
|
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
|
|
|
color: Color(
|
|
|
|
|
|
|
|
0xffb23838),
|
|
|
|
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius.only(
|
|
|
|
|
|
|
|
topLeft: Radius
|
|
|
|
|
|
|
|
.circular(
|
|
|
|
|
|
|
|
6)),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(e.rxMessage != null ? e.rxMessage : "",
|
|
|
|
e.rxMessage != null
|
|
|
|
|
|
|
|
? e.rxMessage
|
|
|
|
|
|
|
|
: "",
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
FontWeight.w400,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets
|
|
|
|
margin: EdgeInsets
|
|
|
|
.symmetric(
|
|
|
|
.symmetric(horizontal: 6, vertical: 0,
|
|
|
|
horizontal: 6,
|
|
|
|
|
|
|
|
vertical: 0,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
languageID == "ar"
|
|
|
|
languageID == "ar" ? e.namen : e.name,
|
|
|
|
? e.namen
|
|
|
|
|
|
|
|
: e.name,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors
|
|
|
|
color: Colors.black, fontSize: 13.0,
|
|
|
|
.black,
|
|
|
|
|
|
|
|
fontSize: 13.0,
|
|
|
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
// padding: const EdgeInsets.only(top: 15, bottom: 10),
|
|
|
|
// padding: const EdgeInsets.only(top: 15, bottom: 10),
|
|
|
|
padding:
|
|
|
|
padding: const EdgeInsets.only(top: 10, bottom: 5),
|
|
|
|
const EdgeInsets
|
|
|
|
child: Texts("SAR ${e.price}",
|
|
|
|
.only(
|
|
|
|
bold: true, fontSize: 14,
|
|
|
|
top: 10,
|
|
|
|
|
|
|
|
bottom:
|
|
|
|
|
|
|
|
5),
|
|
|
|
|
|
|
|
child: Texts(
|
|
|
|
|
|
|
|
"SAR ${e.price}",
|
|
|
|
|
|
|
|
bold: true,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets
|
|
|
|
padding: EdgeInsets.only(right: 10),
|
|
|
|
.only(
|
|
|
|
|
|
|
|
right:
|
|
|
|
|
|
|
|
10),
|
|
|
|
|
|
|
|
// margin: EdgeInsets.only(left: 5),
|
|
|
|
// margin: EdgeInsets.only(left: 5),
|
|
|
|
child: Align(
|
|
|
|
child: Align(alignment: Alignment.topLeft,
|
|
|
|
alignment:
|
|
|
|
child: RatingBar.readOnly(initialRating: e.approvedRatingSum.toDouble(),
|
|
|
|
Alignment
|
|
|
|
|
|
|
|
.topLeft,
|
|
|
|
|
|
|
|
child: RatingBar
|
|
|
|
|
|
|
|
.readOnly(
|
|
|
|
|
|
|
|
initialRating: e
|
|
|
|
|
|
|
|
.approvedRatingSum
|
|
|
|
|
|
|
|
.toDouble(),
|
|
|
|
|
|
|
|
// initialRating: productRate,
|
|
|
|
// initialRating: productRate,
|
|
|
|
size: 13.0,
|
|
|
|
size: 13.0, filledColor: Colors.yellow[700],
|
|
|
|
filledColor:
|
|
|
|
emptyColor: Colors.grey[500],
|
|
|
|
Colors.yellow[
|
|
|
|
isHalfAllowed: true,
|
|
|
|
700],
|
|
|
|
halfFilledIcon: Icons.star_half,
|
|
|
|
emptyColor:
|
|
|
|
filledIcon: Icons.star,
|
|
|
|
Colors.grey[
|
|
|
|
emptyIcon: Icons.star,
|
|
|
|
500],
|
|
|
|
|
|
|
|
isHalfAllowed:
|
|
|
|
|
|
|
|
true,
|
|
|
|
|
|
|
|
halfFilledIcon:
|
|
|
|
|
|
|
|
Icons
|
|
|
|
|
|
|
|
.star_half,
|
|
|
|
|
|
|
|
filledIcon:
|
|
|
|
|
|
|
|
Icons
|
|
|
|
|
|
|
|
.star,
|
|
|
|
|
|
|
|
emptyIcon:
|
|
|
|
|
|
|
|
Icons
|
|
|
|
|
|
|
|
.star,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts("(${e.approvedTotalReviews.toString()})",
|
|
|
|
"(${e.approvedTotalReviews.toString()})",
|
|
|
|
|
|
|
|
// bold: true,
|
|
|
|
// bold: true,
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -664,8 +573,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
return Card(
|
|
|
|
return Card(
|
|
|
|
elevation: 2,
|
|
|
|
elevation: 2,
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
side:
|
|
|
|
side: BorderSide(color: Colors.grey[300], width: 2),
|
|
|
|
BorderSide(color: Colors.grey[300], width: 2),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(10)),
|
|
|
|
borderRadius: BorderRadius.circular(10)),
|
|
|
|
//
|
|
|
|
//
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
@ -692,14 +600,12 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
//wishlistVar[index].id.contains(model.recommendedProductList[index].id)
|
|
|
|
//wishlistVar[index].id.contains(model.recommendedProductList[index].id)
|
|
|
|
!isInWishlist
|
|
|
|
!isInWishlist
|
|
|
|
? IconButton(
|
|
|
|
? IconButton(
|
|
|
|
icon: Icon(
|
|
|
|
icon: Icon(Icons.favorite_border),
|
|
|
|
Icons.favorite_border),
|
|
|
|
|
|
|
|
color: Colors.grey,
|
|
|
|
color: Colors.grey,
|
|
|
|
iconSize: 30,
|
|
|
|
iconSize: 30,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
addToWishlistFunction(
|
|
|
|
addToWishlistFunction(itemID);
|
|
|
|
itemID);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -709,8 +615,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
iconSize: 30,
|
|
|
|
iconSize: 30,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
deleteFromWishlistFunction(
|
|
|
|
deleteFromWishlistFunction(itemID);
|
|
|
|
itemID);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -721,30 +626,20 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
// padding: EdgeInsets.only(left: 25, bottom: 20),
|
|
|
|
// padding: EdgeInsets.only(left: 25, bottom: 20),
|
|
|
|
child: (model.recommendedProductList[index]
|
|
|
|
child: (model.recommendedProductList[index].images != null &&
|
|
|
|
.images !=
|
|
|
|
model.recommendedProductList[index].images.length > 0)
|
|
|
|
null &&
|
|
|
|
? Image.network(model.recommendedProductList[index].images[0].src.toString(),
|
|
|
|
model.recommendedProductList[index]
|
|
|
|
|
|
|
|
.images.length >
|
|
|
|
|
|
|
|
0)
|
|
|
|
|
|
|
|
? Image.network(
|
|
|
|
|
|
|
|
model.recommendedProductList[index]
|
|
|
|
|
|
|
|
.images[0].src
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
|
|
|
|
// item.images[0].src,
|
|
|
|
// item.images[0].src,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
height: 60,
|
|
|
|
height: 60,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Image.asset(
|
|
|
|
: Image.asset("assets/images/no_image.png",
|
|
|
|
"assets/images/no_image.png",
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
height: 60,
|
|
|
|
height: 60,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: model.recommendedProductList[index]
|
|
|
|
width: model.recommendedProductList[index].rxMessage != null
|
|
|
|
.rxMessage !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? MediaQuery.of(context).size.width / 5
|
|
|
|
? MediaQuery.of(context).size.width / 5
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
@ -754,11 +649,8 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
topLeft: Radius.circular(6)),
|
|
|
|
topLeft: Radius.circular(6)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
model.recommendedProductList[index]
|
|
|
|
model.recommendedProductList[index].rxMessage != null
|
|
|
|
.rxMessage !=
|
|
|
|
? model.recommendedProductList[index].rxMessage
|
|
|
|
null
|
|
|
|
|
|
|
|
? model.recommendedProductList[index]
|
|
|
|
|
|
|
|
.rxMessage
|
|
|
|
|
|
|
|
: "",
|
|
|
|
: "",
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
@ -773,12 +665,9 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
vertical: 2,
|
|
|
|
vertical: 2,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(model.recommendedProductList[index].name,
|
|
|
|
model
|
|
|
|
|
|
|
|
.recommendedProductList[index].name,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontSize: 13.0,
|
|
|
|
fontSize: 13.0,
|
|
|
@ -799,8 +688,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
@ -809,10 +697,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
|
|
|
|
child: Align(
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
child: RatingBar.readOnly(
|
|
|
|
child: RatingBar.readOnly(
|
|
|
|
initialRating: model
|
|
|
|
initialRating: model.recommendedProductList[index].approvedRatingSum.toDouble(),
|
|
|
|
.recommendedProductList[index]
|
|
|
|
|
|
|
|
.approvedRatingSum
|
|
|
|
|
|
|
|
.toDouble(),
|
|
|
|
|
|
|
|
// initialRating: productRate,
|
|
|
|
// initialRating: productRate,
|
|
|
|
size: 13.0,
|
|
|
|
size: 13.0,
|
|
|
|
filledColor: Colors.yellow[700],
|
|
|
|
filledColor: Colors.yellow[700],
|
|
|
|