RatingSlider

Pub License

A highly customizable Flutter rating bar that supports drag and tap interactions, half ratings, and dynamic icons.

Rating Slider Demo

Usage

RatingSlider(
  initialRating: _rating,
  iconBuilder: (context, index, type) {
  switch (type) {
    case RatingType.full:
    return const Icon(Icons.star, color: Colors.amber);
    case RatingType.half:
    return const Icon(Icons.star_half, color: Colors.amber);
    case RatingType.empty:
    default:
    return const Icon(Icons.star_border, color: Colors.grey);
    }
  },
  onRatingUpdate: (rating) {
    debugPrint("Rating: $rating");
    setState(() {
    _controller.text = rating.toStringAsFixed(1);
    _rating = rating;
    });
  },
),

For more examples, check the /example folder in the repository.

Libraries

rating_slider