fields property

  1. @override
List<Field> get fields
override

Implementation

@override
List<Field> get fields {
  // Fallback to old implementation if scales are provided
  if (scales != null) {
    return [
      ListField<double>(
        name: 'factor',
        values: scales!,
        initialValue: initialScale ?? scales!.first,
        labelBuilder: (scale) => scale.toStringAsFixed(2),
      ),
    ];
  }

  return [
    DoubleSliderField(
      name: 'factor',
      initialValue: initialScale ?? 1.0,
      min: min,
      max: max,
      divisions: divisions,
    ),
  ];
}