copyWith method

LuckyMotionOptions copyWith({
  1. double? speed,
  2. Duration? accelerationTime,
  3. Duration? decelerationTime,
  4. LuckyEasing? accelerationEasing,
  5. LuckyEasing? decelerationEasing,
  6. LuckyTimebase? timebase,
  7. LuckyStopSolver? stopSolver,
  8. Duration? maxFrameDelta,
  9. double? idleSpinSpeed,
})

返回只替换非 null 参数的副本;例如 options.copyWith(speed: 30)。

Implementation

LuckyMotionOptions copyWith(
        {double? speed,
        Duration? accelerationTime,
        Duration? decelerationTime,
        LuckyEasing? accelerationEasing,
        LuckyEasing? decelerationEasing,
        LuckyTimebase? timebase,
        LuckyStopSolver? stopSolver,
        Duration? maxFrameDelta,
        double? idleSpinSpeed}) =>
    LuckyMotionOptions(
        speed: speed ?? this.speed,
        accelerationTime: accelerationTime ?? this.accelerationTime,
        decelerationTime: decelerationTime ?? this.decelerationTime,
        accelerationEasing: accelerationEasing ?? this.accelerationEasing,
        decelerationEasing: decelerationEasing ?? this.decelerationEasing,
        timebase: timebase ?? this.timebase,
        stopSolver: stopSolver ?? this.stopSolver,
        maxFrameDelta: maxFrameDelta ?? this.maxFrameDelta,
        idleSpinSpeed: idleSpinSpeed ?? this.idleSpinSpeed);