LeverOptions class final
拉杆外观、触发阈值和错峰设置,例如 const LeverOptions(autoPlay: false)。
- Annotations
Constructors
- LeverOptions({LeverSide side = LeverSide.right, double widthFactor = 0.18, double pullThreshold = 0.6, Duration springBack = _defaultDuration, bool autoPlay = true, Duration staggerStop = _defaultDuration, Color knobColor = const Color(0xFFE53935), Color shaftColor = const Color(0xFF9E9E9E)})
-
创建参数;宽度比例须为正,阈值须在 0 到 1 之间。
const
Properties
- autoPlay → bool
-
有效拉杆且阶段允许时自动开始。
final
- hashCode → int
-
与相等性一致的哈希。
no setteroverride
- knobColor → Color
-
拉杆头颜色。
final
- pullThreshold → double
-
松手时达到此比例即触发有效拉杆。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shaftColor → Color
-
杆身颜色。
final
- side → LeverSide
-
拉杆位于老虎机哪一侧。
final
- springBack → Duration
-
松手后的回弹时长。
final
- staggerStop → Duration
-
默认零延迟的列按列下标乘此时长填充。
final
- widthFactor → double
-
拉杆区宽度为总高度乘此比例。
final
Methods
-
copyWith(
{LeverSide? side, double? widthFactor, double? pullThreshold, Duration? springBack, bool? autoPlay, Duration? staggerStop, Color? knobColor, Color? shaftColor}) → LeverOptions -
返回替换指定字段的副本;例如
lever.copyWith(side: LeverSide.left)。 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
全部字段按值比较。
override