copyWith method
Creates a copy of this notification settings but with the given fields replaced with the new values.
Implementation
NotificationSettings copyWith({
String? title,
String? body,
String? stopButton,
String? Function()? androidSnoozeButton,
String? icon,
Color? iconColor,
bool? keepNotificationAfterAlarmEnds,
}) {
return NotificationSettings(
title: title ?? this.title,
body: body ?? this.body,
stopButton: stopButton ?? this.stopButton,
// Wrapped so a caller can remove the snooze action; the older nullable
// fields keep their existing signatures for compatibility.
androidSnoozeButton: androidSnoozeButton != null
? androidSnoozeButton()
: this.androidSnoozeButton,
icon: icon ?? this.icon,
iconColor: iconColor ?? this.iconColor,
keepNotificationAfterAlarmEnds:
keepNotificationAfterAlarmEnds ?? this.keepNotificationAfterAlarmEnds,
);
}