|
|
|
@ -8,82 +8,83 @@ class ReviewsInfo extends StatelessWidget {
|
|
|
|
|
final PharmacyProduct product;
|
|
|
|
|
final ProductDetailViewModel previousModel;
|
|
|
|
|
|
|
|
|
|
const ReviewsInfo({Key key, this.product, this.previousModel}) : super(key: key);
|
|
|
|
|
const ReviewsInfo({Key key, this.product, this.previousModel})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return previousModel.productDetailService.length != 0 &&
|
|
|
|
|
previousModel.productDetailService[0].reviews.length != 0
|
|
|
|
|
previousModel.productDetailService[0].reviews.length != 0
|
|
|
|
|
? ListView.builder(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
itemCount: previousModel.productDetailService[0].reviews.length,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
itemCount: previousModel.productDetailService[0].reviews.length,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
previousModel.productDetailService[0].reviews[index]
|
|
|
|
|
.customerId
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 17,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
previousModel.productDetailService[0]
|
|
|
|
|
.reviews[index].customerId
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 17,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 210),
|
|
|
|
|
child: RatingBar.readOnly(
|
|
|
|
|
initialRating: previousModel
|
|
|
|
|
.productDetailService[0].reviews[index].rating
|
|
|
|
|
.toDouble(),
|
|
|
|
|
size: 15.0,
|
|
|
|
|
filledColor: Colors.yellow[700],
|
|
|
|
|
emptyColor: Colors.grey[500],
|
|
|
|
|
isHalfAllowed: true,
|
|
|
|
|
halfFilledIcon: Icons.star_half,
|
|
|
|
|
filledIcon: Icons.star,
|
|
|
|
|
emptyIcon: Icons.star,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 210),
|
|
|
|
|
child: RatingBar.readOnly(
|
|
|
|
|
initialRating: previousModel.productDetailService[0]
|
|
|
|
|
.reviews[index].rating
|
|
|
|
|
.toDouble(),
|
|
|
|
|
size: 15.0,
|
|
|
|
|
filledColor: Colors.yellow[700],
|
|
|
|
|
emptyColor: Colors.grey[500],
|
|
|
|
|
isHalfAllowed: true,
|
|
|
|
|
halfFilledIcon: Icons.star_half,
|
|
|
|
|
filledIcon: Icons.star,
|
|
|
|
|
emptyIcon: Icons.star,
|
|
|
|
|
child: Text(
|
|
|
|
|
previousModel
|
|
|
|
|
.productDetailService[0].reviews[index].reviewText,
|
|
|
|
|
style: TextStyle(fontSize: 20),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50,
|
|
|
|
|
),
|
|
|
|
|
Divider(height: 1, color: Colors.grey),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
previousModel.productDetailService[0].reviews[index]
|
|
|
|
|
.reviewText,
|
|
|
|
|
style: TextStyle(fontSize: 20),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50,
|
|
|
|
|
),
|
|
|
|
|
Divider(height: 1, color: Colors.grey),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).noReviewsAvailable,
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).noReviewsAvailable,
|
|
|
|
|
),
|
|
|
|
|
// Text('No Reviews Available'),
|
|
|
|
|
);
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|