FormRatingBar<TValue>.view constructor

FormRatingBar<TValue>.view(
  1. num initialValue, {
  2. Key? key,
  3. FormStyle? style,
  4. int iconCount = 5,
  5. double iconSize = 40.0,
  6. Color? activeColor,
  7. Color? inaciveColor,
  8. double? min,
  9. double? max,
  10. Widget itemBuilder(
    1. BuildContext context,
    2. int index
    )?,
  11. bool allowHalfRating = true,
  12. Axis direction = Axis.horizontal,
  13. bool showLabel = false,
  14. 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でアイコンウィジェットそのものを指定でき、iconSizeactiveColorinactiveColorを指定するとデザインを変更することができます。また、iconBuilderを指定するとコールバックでアイコンを作成可能です。

minmaxで値の最小値、最大値を指定できます。

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,
      );