copyWith method

AlarmSettings copyWith({
  1. int? id,
  2. DateTime? dateTime,
  3. String? assetAudioPath,
  4. bool? loopAudio,
  5. bool? vibrate,
  6. bool? volumeMax,
  7. double? fadeDuration,
  8. String? notificationTitle,
  9. String? notificationBody,
  10. bool? enableNotificationOnKill,
  11. bool? stopOnNotificationOpen,
})

Creates a copy of AlarmSettings but with the given fields replaced with the new values.

Implementation

AlarmSettings copyWith({
  int? id,
  DateTime? dateTime,
  String? assetAudioPath,
  bool? loopAudio,
  bool? vibrate,
  bool? volumeMax,
  double? fadeDuration,
  String? notificationTitle,
  String? notificationBody,
  bool? enableNotificationOnKill,
  bool? stopOnNotificationOpen,
}) {
  return AlarmSettings(
    id: id ?? this.id,
    dateTime: dateTime ?? this.dateTime,
    assetAudioPath: assetAudioPath ?? this.assetAudioPath,
    loopAudio: loopAudio ?? this.loopAudio,
    vibrate: vibrate ?? this.vibrate,
    volumeMax: volumeMax ?? this.volumeMax,
    fadeDuration: fadeDuration ?? this.fadeDuration,
    notificationTitle: notificationTitle ?? this.notificationTitle,
    notificationBody: notificationBody ?? this.notificationBody,
    enableNotificationOnKill:
        enableNotificationOnKill ?? this.enableNotificationOnKill,
    stopOnNotificationOpen:
        stopOnNotificationOpen ?? this.stopOnNotificationOpen,
  );
}