copyWith method

LottoOptions copyWith({
  1. Duration? drawInterval,
  2. Duration? ballFlightTime,
  3. bool? sortResults,
  4. double? drawMix,
  5. double? ballRadiusFactor,
  6. LuckyMotionOptions? motion,
  7. LuckyPhysics? physics,
})

返回替换非空参数的副本,例如 options.copyWith(drawMix: 0.5); 无法用 null 清除 physics,需要关闭物理模式时重新构造。

Implementation

LottoOptions copyWith(
        {Duration? drawInterval,
        Duration? ballFlightTime,
        bool? sortResults,
        double? drawMix,
        double? ballRadiusFactor,
        LuckyMotionOptions? motion,
        LuckyPhysics? physics}) =>
    LottoOptions(
        drawInterval: drawInterval ?? this.drawInterval,
        ballFlightTime: ballFlightTime ?? this.ballFlightTime,
        sortResults: sortResults ?? this.sortResults,
        drawMix: drawMix ?? this.drawMix,
        ballRadiusFactor: ballRadiusFactor ?? this.ballRadiusFactor,
        motion: motion ?? this.motion,
        physics: physics ?? this.physics);