MiuixSliderPreference class
带滑块的偏好设置行。对应 Kotlin SliderPreference。
MiuixSlider 放置在 MiuixBasicComponent 的底部区域(bottomAction 之下)。 末尾区域可显示 valueText 与 endActions;当 onClick 非空时追加右箭头图标。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MiuixSliderPreference
Constructors
-
MiuixSliderPreference({Key? key, required double value, required ValueChanged<
double> onValueChange, String? title, MiuixBasicComponentColors? titleColor, String? summary, MiuixBasicComponentColors? summaryColor, Widget? startAction, String? valueText, List<Widget> ? endActions, Widget? bottomAction, VoidCallback? onClick, bool holdDownState = false, bool enabled = true, double min = 0.0, double max = 1.0, int steps = 0, VoidCallback? onValueChangeFinished, bool reverseDirection = false, double sliderHeight = MiuixSliderDefaults.minHeight, MiuixSliderColors? sliderColors, MiuixSliderHapticEffect hapticEffect = MiuixSliderDefaults.defaultHapticEffect, bool showKeyPoints = false, List<double> ? keyPoints, double magnetThreshold = 0.02, EdgeInsetsGeometry insideMargin = MiuixBasicComponentDefaults.insideMargin}) -
const
Properties
- bottomAction → Widget?
-
底部滑块上方的额外内容(可选)。
final
- enabled → bool
-
是否启用。
final
-
endActions
→ List<
Widget> ? -
末尾区域 valueText 之后的额外内容(可选)。
final
- hapticEffect → MiuixSliderHapticEffect
-
触感反馈类型。
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- holdDownState → bool
-
是否处于按压态。
final
- insideMargin → EdgeInsetsGeometry
-
内边距。
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
keyPoints
→ List<
double> ? -
自定义关键点;为 null 时使用 steps 推导。
final
- magnetThreshold → double
-
磁吸阈值(0..1)。
final
- max → double
-
滑块最大值。
final
- min → double
-
滑块最小值。
final
- onClick → VoidCallback?
-
点击回调;非空时末尾追加右箭头图标,整行可点击。
final
-
onValueChange
→ ValueChanged<
double> -
值变更回调。
final
- onValueChangeFinished → VoidCallback?
-
值变更结束回调。
final
- reverseDirection → bool
-
是否反向(从右向左递增)。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showKeyPoints → bool
-
是否显示关键点。
final
- sliderColors → MiuixSliderColors?
-
滑块颜色;为 null 时取 MiuixSliderDefaults.sliderColors。
final
- sliderHeight → double
-
滑块高度。
final
- startAction → Widget?
-
起始侧内容(可选)。
final
- steps → int
-
离散步进数;0 表示连续。
final
- summary → String?
-
行摘要(可选)。
final
- summaryColor → MiuixBasicComponentColors?
-
摘要颜色;为 null 时取 MiuixBasicComponentDefaults.summaryColor。
final
- title → String?
-
行标题(可选)。
final
- titleColor → MiuixBasicComponentColors?
-
标题颜色;为 null 时取 MiuixBasicComponentDefaults.titleColor。
final
- value → double
-
当前滑块值;会被夹到 min..max。
final
- valueText → String?
-
末尾区域显示的当前值文本(可选);样式为
body2.fontSize, 颜色为onSurfaceVariantActions(禁用时disabledOnSecondaryVariant)。final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited