|
|
|
@ -30,6 +30,7 @@ PharmacyProduct specificationData;
|
|
|
|
|
class ProductDetailPage extends StatefulWidget {
|
|
|
|
|
final PharmacyProduct product;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ProductDetailPage(this.product);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@ -661,221 +662,230 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
|
|
|
|
|
.length,
|
|
|
|
|
itemBuilder:
|
|
|
|
|
(context, index) {
|
|
|
|
|
return Card(
|
|
|
|
|
elevation: 2,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
color: Colors
|
|
|
|
|
.grey[
|
|
|
|
|
300],
|
|
|
|
|
width: 2),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius
|
|
|
|
|
.circular(
|
|
|
|
|
10)),
|
|
|
|
|
margin: EdgeInsets
|
|
|
|
|
.symmetric(
|
|
|
|
|
horizontal: 8,
|
|
|
|
|
vertical: 0,
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius
|
|
|
|
|
.all(
|
|
|
|
|
Radius.circular(
|
|
|
|
|
15),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: ProductDetailPage(model.recommendedProductList[index]),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
child: Card(
|
|
|
|
|
elevation: 2,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
color: Colors
|
|
|
|
|
.grey[
|
|
|
|
|
300],
|
|
|
|
|
width: 2),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius
|
|
|
|
|
.circular(
|
|
|
|
|
10)),
|
|
|
|
|
margin: EdgeInsets
|
|
|
|
|
.symmetric(
|
|
|
|
|
horizontal:
|
|
|
|
|
4),
|
|
|
|
|
width: MediaQuery.of(
|
|
|
|
|
context)
|
|
|
|
|
.size
|
|
|
|
|
.width /
|
|
|
|
|
3,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
|
child: //true
|
|
|
|
|
itemID.contains(model.recommendedProductList[index].id)
|
|
|
|
|
// !isInWishlist
|
|
|
|
|
? IconButton(
|
|
|
|
|
icon: Icon(Icons.favorite_border),
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
iconSize: 30,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
addToWishlistFunction(itemID);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: IconButton(
|
|
|
|
|
icon: Icon(Icons.favorite),
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
iconSize: 30,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
deleteFromWishlistFunction(itemID);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
horizontal: 8,
|
|
|
|
|
vertical: 0,
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius
|
|
|
|
|
.all(
|
|
|
|
|
Radius.circular(
|
|
|
|
|
15),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets
|
|
|
|
|
.symmetric(
|
|
|
|
|
horizontal:
|
|
|
|
|
4),
|
|
|
|
|
width: MediaQuery.of(
|
|
|
|
|
context)
|
|
|
|
|
.size
|
|
|
|
|
.width /
|
|
|
|
|
3,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
|
child: //true
|
|
|
|
|
itemID.contains(model.recommendedProductList[index].id)
|
|
|
|
|
// !isInWishlist
|
|
|
|
|
? IconButton(
|
|
|
|
|
icon: Icon(Icons.favorite_border),
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
iconSize: 30,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
addToWishlistFunction(itemID);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: IconButton(
|
|
|
|
|
icon: Icon(Icons.favorite),
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
iconSize: 30,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
deleteFromWishlistFunction(itemID);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
//
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
0,
|
|
|
|
|
16,
|
|
|
|
|
10,
|
|
|
|
|
16),
|
|
|
|
|
alignment:
|
|
|
|
|
Alignment.center,
|
|
|
|
|
// padding: EdgeInsets.only(left: 25, bottom: 20),
|
|
|
|
|
child: (model.recommendedProductList[index].images != null &&
|
|
|
|
|
model.recommendedProductList[index].images.length > 0)
|
|
|
|
|
? Image.network(
|
|
|
|
|
model.recommendedProductList[index].images[0].src.toString(),
|
|
|
|
|
// item.images[0].src,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
height: 60,
|
|
|
|
|
)
|
|
|
|
|
: Image.asset(
|
|
|
|
|
"assets/images/no_image.png",
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
height: 60,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: model.recommendedProductList[index].rxMessage !=
|
|
|
|
|
null
|
|
|
|
|
? MediaQuery.of(context).size.width /
|
|
|
|
|
5
|
|
|
|
|
: 0,
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
color:
|
|
|
|
|
Color(0xffb23838),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
|
),
|
|
|
|
|
child:
|
|
|
|
|
Texts(
|
|
|
|
|
model.recommendedProductList[index].rxMessage != null
|
|
|
|
|
? model.recommendedProductList[index].rxMessage
|
|
|
|
|
: "",
|
|
|
|
|
color:
|
|
|
|
|
Colors.white,
|
|
|
|
|
regular:
|
|
|
|
|
true,
|
|
|
|
|
fontSize:
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
0,
|
|
|
|
|
16,
|
|
|
|
|
10,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.w400,
|
|
|
|
|
16),
|
|
|
|
|
alignment:
|
|
|
|
|
Alignment.center,
|
|
|
|
|
// padding: EdgeInsets.only(left: 25, bottom: 20),
|
|
|
|
|
child: (model.recommendedProductList[index].images != null &&
|
|
|
|
|
model.recommendedProductList[index].images.length > 0)
|
|
|
|
|
? Image.network(
|
|
|
|
|
model.recommendedProductList[index].images[0].src.toString(),
|
|
|
|
|
// item.images[0].src,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
height: 60,
|
|
|
|
|
)
|
|
|
|
|
: Image.asset(
|
|
|
|
|
"assets/images/no_image.png",
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
height: 60,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets
|
|
|
|
|
.symmetric(
|
|
|
|
|
horizontal:
|
|
|
|
|
6,
|
|
|
|
|
vertical: 0,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
languageID ==
|
|
|
|
|
"ar"
|
|
|
|
|
? model.recommendedProductList[index].namen
|
|
|
|
|
: model.recommendedProductList[index].name,
|
|
|
|
|
style:
|
|
|
|
|
TextStyle(
|
|
|
|
|
color:
|
|
|
|
|
Colors.black,
|
|
|
|
|
fontSize:
|
|
|
|
|
13.0,
|
|
|
|
|
Container(
|
|
|
|
|
width: model.recommendedProductList[index].rxMessage !=
|
|
|
|
|
null
|
|
|
|
|
? MediaQuery.of(context).size.width /
|
|
|
|
|
5
|
|
|
|
|
: 0,
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
color:
|
|
|
|
|
Color(0xffb23838),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
|
),
|
|
|
|
|
child:
|
|
|
|
|
Texts(
|
|
|
|
|
model.recommendedProductList[index].rxMessage != null
|
|
|
|
|
? model.recommendedProductList[index].rxMessage
|
|
|
|
|
: "",
|
|
|
|
|
color:
|
|
|
|
|
Colors.white,
|
|
|
|
|
regular:
|
|
|
|
|
true,
|
|
|
|
|
fontSize:
|
|
|
|
|
10,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.w400,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets
|
|
|
|
|
.symmetric(
|
|
|
|
|
horizontal:
|
|
|
|
|
6,
|
|
|
|
|
vertical: 0,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
languageID ==
|
|
|
|
|
"ar"
|
|
|
|
|
? model.recommendedProductList[index].namen
|
|
|
|
|
: model.recommendedProductList[index].name,
|
|
|
|
|
style:
|
|
|
|
|
TextStyle(
|
|
|
|
|
color:
|
|
|
|
|
Colors.black,
|
|
|
|
|
fontSize:
|
|
|
|
|
13.0,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
Padding(
|
|
|
|
|
// padding: const EdgeInsets.only(top: 15, bottom: 10),
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
top:
|
|
|
|
|
10,
|
|
|
|
|
bottom:
|
|
|
|
|
5),
|
|
|
|
|
child:
|
|
|
|
|
Texts(
|
|
|
|
|
"SAR ${model.recommendedProductList[index].price}",
|
|
|
|
|
bold:
|
|
|
|
|
true,
|
|
|
|
|
fontSize:
|
|
|
|
|
14,
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
top:
|
|
|
|
|
10,
|
|
|
|
|
bottom:
|
|
|
|
|
5),
|
|
|
|
|
child:
|
|
|
|
|
Texts(
|
|
|
|
|
"SAR ${model.recommendedProductList[index].price}",
|
|
|
|
|
bold:
|
|
|
|
|
true,
|
|
|
|
|
fontSize:
|
|
|
|
|
14,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.only(right: 10),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.only(right: 10),
|
|
|
|
|
// margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child:
|
|
|
|
|
Align(
|
|
|
|
|
alignment:
|
|
|
|
|
Alignment.topLeft,
|
|
|
|
|
child:
|
|
|
|
|
RatingBar.readOnly(
|
|
|
|
|
initialRating:
|
|
|
|
|
model.recommendedProductList[index].approvedRatingSum.toDouble(),
|
|
|
|
|
Align(
|
|
|
|
|
alignment:
|
|
|
|
|
Alignment.topLeft,
|
|
|
|
|
child:
|
|
|
|
|
RatingBar.readOnly(
|
|
|
|
|
initialRating:
|
|
|
|
|
model.recommendedProductList[index].approvedRatingSum.toDouble(),
|
|
|
|
|
// initialRating: productRate,
|
|
|
|
|
size:
|
|
|
|
|
13.0,
|
|
|
|
|
filledColor:
|
|
|
|
|
Colors.yellow[700],
|
|
|
|
|
emptyColor:
|
|
|
|
|
Colors.grey[500],
|
|
|
|
|
isHalfAllowed:
|
|
|
|
|
true,
|
|
|
|
|
halfFilledIcon:
|
|
|
|
|
Icons.star_half,
|
|
|
|
|
filledIcon:
|
|
|
|
|
Icons.star,
|
|
|
|
|
emptyIcon:
|
|
|
|
|
Icons.star,
|
|
|
|
|
size:
|
|
|
|
|
13.0,
|
|
|
|
|
filledColor:
|
|
|
|
|
Colors.yellow[700],
|
|
|
|
|
emptyColor:
|
|
|
|
|
Colors.grey[500],
|
|
|
|
|
isHalfAllowed:
|
|
|
|
|
true,
|
|
|
|
|
halfFilledIcon:
|
|
|
|
|
Icons.star_half,
|
|
|
|
|
filledIcon:
|
|
|
|
|
Icons.star,
|
|
|
|
|
emptyIcon:
|
|
|
|
|
Icons.star,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
|
|
|
|
|
Texts(
|
|
|
|
|
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
|
|
|
|
|
// bold: true,
|
|
|
|
|
fontSize:
|
|
|
|
|
12,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
fontSize:
|
|
|
|
|
12,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|