copyWith method

AlarmSettings copyWith({
  1. DateTime? dateTime,
  2. String? assetAudioPath,
  3. bool? loopAudio,
  4. bool? vibrate,
  5. double? fadeDuration,
  6. String? notificationTitle,
  7. String? notificationBody,
})

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

Implementation

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