copyWith method

LeverOptions copyWith({
  1. LeverSide? side,
  2. double? widthFactor,
  3. double? pullThreshold,
  4. Duration? springBack,
  5. bool? autoPlay,
  6. Duration? staggerStop,
  7. Color? knobColor,
  8. Color? shaftColor,
})

返回替换指定字段的副本;例如 lever.copyWith(side: LeverSide.left)。

Implementation

LeverOptions copyWith(
        {LeverSide? side,
        double? widthFactor,
        double? pullThreshold,
        Duration? springBack,
        bool? autoPlay,
        Duration? staggerStop,
        Color? knobColor,
        Color? shaftColor}) =>
    LeverOptions(
        side: side ?? this.side,
        widthFactor: widthFactor ?? this.widthFactor,
        pullThreshold: pullThreshold ?? this.pullThreshold,
        springBack: springBack ?? this.springBack,
        autoPlay: autoPlay ?? this.autoPlay,
        staggerStop: staggerStop ?? this.staggerStop,
        knobColor: knobColor ?? this.knobColor,
        shaftColor: shaftColor ?? this.shaftColor);