copyWith method
LottoOptions
copyWith({
- Duration? drawInterval,
- Duration? ballFlightTime,
- bool? sortResults,
- double? drawMix,
- double? ballRadiusFactor,
- LuckyMotionOptions? motion,
- 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);