Slider
| Название типа | Поддерживает анимации свойств | Контроллируемый по умолчанию | Может содержать связанное действие | Ссылка |
|---|---|---|---|---|
| TypeName | ✗ | ✔️ | ✔️ | link |
к сведению
Значение, хранимое виджетом, может быть использовано в качестве источника данных для действий.
Атрибуты (устаревшие модели)
final class SliderAttributes extends AttendedModel<double>
implements DuitAttributes<SliderAttributes> {
final double? min, max, secondaryTrackValue;
final int? divisions;
final String? label;
final Color? activeColor, inactiveColor, secondaryActiveColor, thumbColor;
final WidgetStateProperty<Color>? overlayColor;
final bool autofocus;
final ServerAction? onChanged, onChangeStart, onChangeEnd;
final SliderInteraction? allowedInteraction;
SliderAttributes({
required super.value,
this.min,
this.max,
this.secondaryTrackValue,
this.divisions,
this.label,
this.activeColor,
this.inactiveColor,
this.secondaryActiveColor,
this.thumbColor,
this.overlayColor,
this.autofocus = false,
this.onChanged,
this.onChangeStart,
this.onChangeEnd,
this.allowedInteraction,
});
Пример использования
- Go
Slider(
&duit_attributes.SliderAttributes[duit_core.RemoteAction, duit_color.ColorString]{
OnChangeEnd: &duit_core.RemoteAction{
Event: "/on_change_end",
DependsOn: []*duit_core.ActionDependency{
{
Id: "id",
Target: "value",
},
},
},
Min: 0,
Max: 100,
Value: 25,
Divisions: 5,
},
"id",
)