Add stars to review list

Co-authored-by: Reimar <mail@reim.ar>
This commit is contained in:
Alexandertp 2024-09-05 18:39:43 +02:00
parent 0dcfb2ea1e
commit d767e0bb85

View File

@ -19,7 +19,9 @@ class _ReviewListState extends State<ReviewListPage> {
return SideMenu( return SideMenu(
selectedIndex: -1, selectedIndex: -1,
body: Scaffold(body: SingleChildScrollView(child: Container( body: Scaffold(
backgroundColor: Color(0xFFF9F9F9),
body: SingleChildScrollView(child: Container(
decoration: const BoxDecoration(color: Color(0xFFF9F9F9)), decoration: const BoxDecoration(color: Color(0xFFF9F9F9)),
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
@ -52,11 +54,16 @@ class _ReviewListState extends State<ReviewListPage> {
children: [ children: [
Text(review.title, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 24)), Text(review.title, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 24)),
Text(review.content), Text(review.content),
const SizedBox(height: 10),
Row(children: [
for (var i = 0; i < review.rating; i++) const Icon(Icons.star, color: Colors.yellow),
for (var i = review.rating; i < 5; i++) const Icon(Icons.star_border),
]),
], ],
), ),
), ),
], ],
) ),
)).toList(), )).toList(),
), ),
)), )),
@ -70,6 +77,7 @@ class _ReviewListState extends State<ReviewListPage> {
tooltip: "Write a Review", tooltip: "Write a Review",
child: const Icon(CupertinoIcons.plus), child: const Icon(CupertinoIcons.plus),
), ),
)); ),
);
} }
} }