copyWith method

CountdownConfig copyWith({
  1. Duration? duration,
  2. Duration? interval,
  3. bool? autoStart,
  4. bool? showControls,
  5. bool? showReset,
  6. bool? showMilliseconds,
  7. Duration? animationDuration,
  8. bool? enableHapticFeedback,
  9. String customFormatter(
    1. Duration
    )?,
  10. VoidCallback? onFinish,
  11. VoidCallback? onPause,
  12. VoidCallback? onResume,
  13. VoidCallback? onReset,
  14. void onTick(
    1. Duration remaining
    )?,
})

Creates a copy of this config with the given fields replaced

Implementation

CountdownConfig copyWith({
  Duration? duration,
  Duration? interval,
  bool? autoStart,
  bool? showControls,
  bool? showReset,
  bool? showMilliseconds,
  Duration? animationDuration,
  bool? enableHapticFeedback,
  String Function(Duration)? customFormatter,
  VoidCallback? onFinish,
  VoidCallback? onPause,
  VoidCallback? onResume,
  VoidCallback? onReset,
  void Function(Duration remaining)? onTick,
}) {
  return CountdownConfig(
    duration: duration ?? this.duration,
    interval: interval ?? this.interval,
    autoStart: autoStart ?? this.autoStart,
    showControls: showControls ?? this.showControls,
    showReset: showReset ?? this.showReset,
    showMilliseconds: showMilliseconds ?? this.showMilliseconds,
    animationDuration: animationDuration ?? this.animationDuration,
    enableHapticFeedback: enableHapticFeedback ?? this.enableHapticFeedback,
    customFormatter: customFormatter ?? this.customFormatter,
    onFinish: onFinish ?? this.onFinish,
    onPause: onPause ?? this.onPause,
    onResume: onResume ?? this.onResume,
    onReset: onReset ?? this.onReset,
    onTick: onTick ?? this.onTick,
  );
}