RatingBar.builder constructor

const RatingBar.builder({
  1. required IndexedWidgetBuilder itemBuilder,
  2. required ValueChanged<double> onRatingUpdate,
  3. Color? glowColor,
  4. double? maxRating,
  5. TextDirection? textDirection,
  6. Color? unratedColor,
  7. bool allowHalfRating = false,
  8. Axis direction = Axis.horizontal,
  9. bool glow = true,
  10. double glowRadius = 2,
  11. bool ignoreGestures = false,
  12. double initialRating = 0.0,
  13. int itemCount = 5,
  14. EdgeInsetsGeometry itemPadding = EdgeInsets.zero,
  15. double itemSize = 40.0,
  16. double minRating = 0,
  17. bool tapOnlyMode = false,
  18. bool updateOnDrag = false,
  19. WrapAlignment wrapAlignment = WrapAlignment.start,
})

Creates RatingBar using the itemBuilder.

Implementation

const RatingBar.builder({
  /// {@template flutterRatingBar.itemBuilder}
  /// Widget for each rating bar item.
  /// {@endtemplate}
  required IndexedWidgetBuilder itemBuilder,
  required this.onRatingUpdate,
  this.glowColor,
  this.maxRating,
  this.textDirection,
  this.unratedColor,
  this.allowHalfRating = false,
  this.direction = Axis.horizontal,
  this.glow = true,
  this.glowRadius = 2,
  this.ignoreGestures = false,
  this.initialRating = 0.0,
  this.itemCount = 5,
  this.itemPadding = EdgeInsets.zero,
  this.itemSize = 40.0,
  this.minRating = 0,
  this.tapOnlyMode = false,
  this.updateOnDrag = false,
  this.wrapAlignment = WrapAlignment.start,
})  : _itemBuilder = itemBuilder,
      _ratingWidget = null;