smoothratingbar
a star rating with touch and swipe rate enabled.
- supports half rate and full rate (1.0 or 0.5)
- swipe for incrementing/decrementing rate amount
- change star body and boundary colors independently
- control size of the star rating
- set your desired total star count
- supports click-to-rate
- spacing between stars
getting started
in your flutter project add the dependency:
dependencies:
...
smooth_star_rating: 1.0.3
usage example about star rating
import 'package:smooth_star_rating/smooth_star_rating.dart';
smoothstarrating(
allowhalfrating: false,
onratingchanged: (v) {
rating = v;
setstate(() {});
},
starcount: 5,
rating: rating,
size: 40.0,
color: colors.green,
bordercolor: colors.green,
spacing:0.0
)
constructor parameters
allowhalfrating - whether to use whole number for rating(1.0 or 0.5)
onratingchanged(int rating) - rating changed callback
starcount - the maximum amount of stars
rating - the current value of rating
size - the size of a single star
color - the body color of star
bordercolor - the border color of star
spacing - spacing between stars(default is 0.0)
screenshots
full rating
half rating
Comments are closed.