FormRatingBar<TValue>.view constructor
- num initialValue, {
- Key? key,
- FormStyle? style,
- int iconCount = 5,
- double iconSize = 40.0,
- Color? activeColor,
- Color? inaciveColor,
- double? min,
- double? max,
- Widget itemBuilder(
- BuildContext context,
- int index
- bool allowHalfRating = true,
- Axis direction = Axis.horizontal,
- bool showLabel = false,
- Widget? icon,
Widget to display & edit by number of stars by passing double.
If a value is given in initialValue
, that value will be displayed.
The value cannot be changed.
iconCount
allows you to specify the number of icons. The icon widget itself can be specified with icon
, and the design can be changed by specifying iconSize
, activeColor
, and inactiveColor. Also, if iconBuilder is specified, the icon can be created in a callback.
The minimum and maximum values can be specified with min
and max
.
You can specify whether to allow half stars with allowHalfRating
.
If showLabel
is specified, the actual value can be displayed as a numerical value.
doubleを渡して星の数で表示&編集するためのウィジェット。
initialValue
で値を与えるとその値が表示されます。
値の変更はできません。
iconCount
を使用するとアイコンの数を指定できます。icon
でアイコンウィジェットそのものを指定でき、iconSize
やactiveColor
、inactiveColorを指定するとデザインを変更することができます。また、iconBuilderを指定するとコールバックでアイコンを作成可能です。
min
とmax
で値の最小値、最大値を指定できます。
allowHalfRating
で半分の星を許可するかどうかを指定できます。
showLabel
を指定すると実際の値を数値として表示することが可能です。
Implementation
FormRatingBar.view(
num initialValue, {
Key? key,
FormStyle? style,
int iconCount = 5,
double iconSize = 40.0,
Color? activeColor,
Color? inaciveColor,
double? min,
double? max,
Widget Function(BuildContext context, int index)? itemBuilder,
bool allowHalfRating = true,
Axis direction = Axis.horizontal,
bool showLabel = false,
Widget? icon,
}) : this(
initialValue: initialValue.toDouble(),
key: key,
style: style,
iconCount: iconCount,
iconSize: iconSize,
activeColor: activeColor,
inactiveColor: inaciveColor,
min: min,
max: max,
iconBuilder: itemBuilder,
allowHalfRating: allowHalfRating,
direction: direction,
showLabel: showLabel,
icon: icon,
readOnly: true,
);