Lot of users are used Rating controls used to rate their products or rate favorite articles.If you are looking something like related to that this plugins are very helpful for you.Simple rating bar is highly customizable rating widgets that support partial and fully rating feature .also we can use custom icons for rating bar indicator .
Features
- We can set minimum and maximum value of rating
- We can use any widgets can be used as as rating bar/indicator items
- Different widgets can be used in same rating bar as per position
- Its support vertical layout
- Its Supports RTL mode
Implementation
We can include this plugin in 3 different ways
- Using Item Builder
- Using Rating Widgets
- Using Item Builder with Index
Using itemBuilder

RatingBar(
initialRating: 3,
minRating: 1,
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
itemBuilder: (context, _) => Icon(
Icons.star,
color: Colors.green,
),
onRatingUpdate: (rating) {
print(rating);
},
);
Using rating widgets

RatingBar(
initialRating: 3,
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
ratingWidget: RatingWidget(
full: _image('assets/heart.png'),
half: _image('assets/heart_half.png'),
empty: _image('assets/heart_border.png'),
),
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
onRatingUpdate: (rating) {
print(rating);
},
);
Using item builder with index

RatingBar(
initialRating: 3,
itemCount: 5,
itemBuilder: (context, index) {
switch (index) {
case 0:
return Icon(
Icons.sentiment_very_dissatisfied,
color: Colors.red,
);
case 1:
return Icon(
Icons.sentiment_dissatisfied,
color: Colors.redAccent,
);
case 2:
return Icon(
Icons.sentiment_neutral,
color: Colors.amber,
);
case 3:
return Icon(
Icons.sentiment_satisfied,
color: Colors.lightGreen,
);
case 4:
return Icon(
Icons.sentiment_very_satisfied,
color: Colors.green,
);
}
},
onRatingUpdate: (rating) {
print(rating);
},
;
Using Flutter Rating Bar Indicator

RatingBarIndicator(
rating: 2.75,
itemBuilder: (context, index) => Icon(
Icons.star,
color: Colors.amber,
),
itemCount: 5,
itemSize: 50.0,
direction: Axis.vertical,
),
For more details related to this plugin please checkout the below URL.