LeverOptions constructor

const LeverOptions({
  1. LeverSide side = LeverSide.right,
  2. double widthFactor = 0.18,
  3. double pullThreshold = 0.6,
  4. Duration springBack = _defaultDuration,
  5. bool autoPlay = true,
  6. Duration staggerStop = _defaultDuration,
  7. Color knobColor = const Color(0xFFE53935),
  8. Color shaftColor = const Color(0xFF9E9E9E),
})

创建参数;宽度比例须为正,阈值须在 0 到 1 之间。

Implementation

const LeverOptions(
    {this.side = LeverSide.right,
    this.widthFactor = 0.18,
    this.pullThreshold = 0.6,
    this.springBack = _defaultDuration,
    this.autoPlay = true,
    this.staggerStop = _defaultDuration,
    this.knobColor = const Color(0xFFE53935),
    this.shaftColor = const Color(0xFF9E9E9E)})
    : assert(widthFactor > 0),
      assert(pullThreshold >= 0 && pullThreshold <= 1);