TKeyValue.rating constructor
TKeyValue.rating(
- String key,
- double? rating, {
- int itemCount = 5,
- double itemSize = 14.0,
- Color? color,
- Color? unratedColor,
- bool allowHalfRating = true,
- double spacing = 2.0,
- bool disabled = true,
- ValueChanged<
double?> ? onValueChanged, - Widget? icon,
- double? width,
- Alignment? alignment,
- double? minWidth,
- double? maxWidth,
Creates a key-value item for displaying star ratings using TRating.
Implementation
factory TKeyValue.rating(
String key,
double? rating, {
int itemCount = 5,
double itemSize = 14.0,
Color? color,
Color? unratedColor,
bool allowHalfRating = true,
double spacing = 2.0,
bool disabled = true,
ValueChanged<double?>? onValueChanged,
Widget? icon,
double? width,
Alignment? alignment,
double? minWidth,
double? maxWidth,
}) {
Widget? widget;
if (rating != null) {
widget = TRating(
value: rating,
itemCount: itemCount,
itemSize: itemSize,
color: color,
unratedColor: unratedColor,
disabled: disabled,
allowHalfRating: allowHalfRating,
spacing: spacing,
onValueChanged: onValueChanged,
);
}
return TKeyValue(
key,
value: rating?.toString(),
widget: widget,
icon: icon,
width: width,
alignment: alignment,
minWidth: minWidth,
maxWidth: maxWidth,
);
}