RatingBar constructor
const
RatingBar({
- Key? key,
- required IconData filledIcon,
- required IconData emptyIcon,
- required void onRatingChanged()?,
- double initialRating = 0.0,
- int maxRating = 5,
- IconData? halfFilledIcon,
- bool isHalfAllowed = false,
- Alignment alignment = Alignment.centerLeft,
- Axis direction = Axis.horizontal,
- Color filledColor = Colors.amber,
- Color emptyColor = Colors.grey,
- Color halfFilledColor = Colors.amber,
- double size = 32,
Default constructor for RatingBar.
Implementation
const RatingBar({
super.key,
required this.filledIcon,
required this.emptyIcon,
required this.onRatingChanged,
this.initialRating = 0.0,
this.maxRating = 5,
this.halfFilledIcon,
this.isHalfAllowed = false,
this.alignment = Alignment.centerLeft,
this.direction = Axis.horizontal,
this.filledColor = Colors.amber,
this.emptyColor = Colors.grey,
this.halfFilledColor = Colors.amber,
this.size = 32,
}) : _readOnly = false,
assert(
!isHalfAllowed || halfFilledIcon != null,
'Please provide halfFilledIcon if isHalfAllowed is true.',
);