RatingBar constructor
const
RatingBar({
- Key? key,
- required double rating,
- ValueChanged<
double> ? onChanged, - int amount = 5,
- Duration animationDuration = Duration.zero,
- Curve? animationCurve,
- IconData? icon,
- double iconSize = 20.0,
- Color? ratedIconColor,
- Color? unratedIconColor,
- String? semanticLabel,
- FocusNode? focusNode,
- bool autofocus = false,
- double starSpacing = 0,
- DragStartBehavior dragStartBehavior = DragStartBehavior.down,
Creates a new rating bar.
rating must be greater than 0 and less than amount
starSpacing and amount must be greater than 0
Implementation
const RatingBar({
super.key,
required this.rating,
this.onChanged,
this.amount = 5,
this.animationDuration = Duration.zero,
this.animationCurve,
this.icon,
this.iconSize = 20.0,
this.ratedIconColor,
this.unratedIconColor,
this.semanticLabel,
this.focusNode,
this.autofocus = false,
this.starSpacing = 0,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(rating >= 0 && rating <= amount),
assert(starSpacing >= 0),
assert(amount > 0);