Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created December 28, 2020 17:47
Show Gist options
  • Save azamsharp/efe9d1c1468603b3af06b5db35f40cc8 to your computer and use it in GitHub Desktop.
Save azamsharp/efe9d1c1468603b3af06b5db35f40cc8 to your computer and use it in GitHub Desktop.
class _Rating extends State<Rating> {
Widget _buildRatingStar(int index) {
return Icon(Icons.star_border_outlined);
}
Widget _buildBody() {
final stars = List<Widget>.generate(this.widget.maximumRating, (index) {
return GestureDetector(
child: _buildRatingStar(index),
onTap: () {
},
);
});
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: stars,
),
],
);
}
@override
Widget build(BuildContext context) {
return _buildBody();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment