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