https://github.com/floodoo/rating_summary
Create a summary statistic Widget to display the rating and average rating of a product.
https://github.com/floodoo/rating_summary
flutter rating rating-component rating-statistics ratingbar summary-statistics widget
Last synced: 2 months ago
JSON representation
Create a summary statistic Widget to display the rating and average rating of a product.
- Host: GitHub
- URL: https://github.com/floodoo/rating_summary
- Owner: floodoo
- License: mit
- Created: 2022-10-22T12:24:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-03T20:19:26.000Z (about 1 year ago)
- Last Synced: 2025-10-23T06:31:19.891Z (6 months ago)
- Topics: flutter, rating, rating-component, rating-statistics, ratingbar, summary-statistics, widget
- Language: C++
- Homepage: https://pub.dev/packages/rating_summary
- Size: 619 KB
- Stars: 2
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Rating Summary Widget
Create a summary statistic Widget to display the rating and average rating of a product.


## Installing:
1. Add the dependency in your `pubspec.yaml` file.
```yaml
dependencies:
rating_summary: ^1.0.2+1
```
2. Import the `rating_summary` package.
```dart
import 'package:rating_summary/rating_summary.dart';
```
## Usage
```dart
RatingSummary(
counter: 13,
average: 3.846,
showAverage: true,
counterFiveStars: 5,
counterFourStars: 4,
counterThreeStars: 2,
counterTwoStars: 1,
counterOneStars: 1,
)
```
### Parameters
| Parameter | Description | Type | Default | Required |
| ----------------- | ------------------------------------------- | --------- | ---------------------------------------------------- | -------- |
| counter | The total number of ratings. | int | - | ✓ |
| average | The average rating. | double | 0.0 | - |
| showAverage | Show the average rating indicator. | bool | true | - |
| averageStyle | The style of the average rating indicator. | TextStyle | TextStyle(fontWeight: FontWeight.bold, fontSize: 40) | - |
| counterFiveStars | The number of 5 star ratings. | int | 0 | - |
| counterFourStars | The number of 4 star ratings. | int | 0 | - |
| counterThreeStars | The number of 3 star ratings. | int | 0 | - |
| counterTwoStars | The number of 2 star ratings. | int | 0 | - |
| counterOneStars | The number of 1 star ratings. | int | 0 | - |
| labelCounterFiveStars | The label of the 5 star rating. | Widget | Text( '5', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)) | - |
| labelCounterFourStars | The label of the 4 star rating. | Widget | Text( '4', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)) | - |
| labelCounterThreeStars | The label of the 3 star rating. | Widget | Text( '3', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)) | - |
| labelCounterTwoStars | The label of the 2 star rating. | Widget | Text( '2', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)) | - |
| labelCounterOneStars | The label of the 1 star rating. | Widget | Text( '1', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)) | - |
| labelCounterFiveStarsStyle | The style of the 5 star rating label. | TextStyle | TextStyle(fontSize: 14, fontWeight: FontWeight.bold) | - |
| labelCounterFourStarsStyle | The style of the 4 star rating label. | TextStyle | TextStyle(fontSize: 14, fontWeight: FontWeight.bold) | - |
| labelCounterThreeStarsStyle | The style of the 3 star rating label. | TextStyle | TextStyle(fontSize: 14, fontWeight: FontWeight.bold) | - |
| labelCounterTwoStarsStyle | The style of the 2 star rating label. | TextStyle | TextStyle(fontSize: 14, fontWeight: FontWeight.bold) | - |
| labelCounterOneStarsStyle | The style of the 1 star rating label. | TextStyle | TextStyle(fontSize: 14, fontWeight: FontWeight.bold) | - |
| label | The label of the rating summary. | String | "Rating" | - |
| labelStyle | The style of the label. | TextStyle | TextStyle(fontWeight: FontWeight.w600) | - |
| color | The primary color of the rating summary. | Color | Colors.amber | - |
| backgroundColor | The background color of the rating summary. | Color | Color(0xFFEEEEEE) | - |
| space | The space between the label and the bar. | double | 20 | - |
| thickness | The thickness of the bar. | doubel | 10 | - |
| starColor | The color of stars. | Color | Colors.amber | - |
| alignment | The alignment of rating summary. | CrossAxisAlignment | CrossAxisAlignment.center | - |