Flutter开发之Slider

Flutter开发之Slider

在这里插入图片描述
本文是关于介绍Slider相关属性的含义。

class SliderThemeData {

/// slider轨道的高度
final double? trackHeight;
/// 滑块滑过的轨道颜色
final Color? activeTrackColor;
/// 滑块未滑过的轨道颜色
final Color? inactiveTrackColor;
/// 滑块滑过的二级轨道颜色
final Color? secondaryActiveTrackColor;
/// 不可选时滑块滑过的轨道颜色
final Color? disabledActiveTrackColor;
/// 不可选时滑块滑过的二级轨道颜色
final Color? disabledSecondaryActiveTrackColor;
/// 不可选时滑块未滑过的轨道颜色
final Color? disabledInactiveTrackColor;
/// 滑块滑过的轨道上刻度的颜色
final Color? activeTickMarkColor;
/// 滑块未滑过的轨道上刻度的颜色
final Color? inactiveTickMarkColor;
/// 不可选时滑块滑过的轨道上刻度的颜色
final Color? disabledActiveTickMarkColor;
/// 不可选时滑块未滑过的轨道上刻度的颜色
final Color? disabledInactiveTickMarkColor;
/// 滑块颜色
final Color? thumbColor;
/// 手指触碰滑块周边颜色
final Color? overlappingShapeStrokeColor;
/// 不可选时滑块颜色
final Color? disabledThumbColor;
/// 滑块按下去滑块周边颜色
final Color? overlayColor;
/// 刻度气泡颜色
final Color? valueIndicatorColor;
/// 滑块按下的形状
final SliderComponentShape? overlayShape;
/// 刻度形状
final SliderTickMarkShape? tickMarkShape;
/// 滑块形状
final SliderComponentShape? thumbShape;
/// 轨道形状
final SliderTrackShape? trackShape;
/// 气泡形状
final SliderComponentShape? valueIndicatorShape;

/// RangeSlider
/// 刻度形状
final RangeSliderTickMarkShape? rangeTickMarkShape;
/// 滑块形状
final RangeSliderThumbShape? rangeThumbShape;
/// 轨道形状
final RangeSliderTrackShape? rangeTrackShape;
/// 气泡形状
final RangeSliderValueIndicatorShape? rangeValueIndicatorShape;
/// 气泡的显示方式
final ShowValueIndicator? showValueIndicator;
/// 气泡文本
final TextStyle? valueIndicatorTextStyle;
/// 最小间隔
final double? minThumbSeparation;
/// 滑块的选择规则
final RangeThumbSelector? thumbSelector;
/// 鼠标光标
final MaterialStateProperty<MouseCursor?>? mouseCursor;
/// 允许滑块与用户的交互方式
final SliderInteraction? allowedInteraction;

}
class Slider {

/// 当前进度
final double value;
/// 二级轨道值
final double? secondaryTrackValue;
/// 进度发生变化
final ValueChanged<double>? onChanged;
final ValueChanged<double>? onChangeStart;
final ValueChanged<double>? onChangeEnd;
/// 最小值
final double min;
/// 最大值
final double max;
/// 分割刻度的个数
final int? divisions;
/// 滑块上方指示器
final String? label;
/// 滑块滑过的轨道颜色
final Color? activeColor;
/// 滑块未滑过的轨道颜色
final Color? inactiveColor;
/// 滑块滑过的二级轨道颜色
final Color? secondaryActiveColor;
/// 滑块颜色
final Color? thumbColor;
/// 滑块按下去的颜色
final MaterialStateProperty<Color?>? overlayColor;
/// 鼠标
final MouseCursor? mouseCursor;
/// 滑块语意值回调
final SemanticFormatterCallback? semanticFormatterCallback;
final FocusNode? focusNode;
final bool autofocus;
/// 允许滑块与用户的交互方式
final SliderInteraction? allowedInteraction;

}

具体使用方式按照含义去使用即可。

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Kevin写代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值