copyWith method

NotificationSettings copyWith({
  1. String? title,
  2. String? body,
  3. String? stopButton,
  4. String? icon,
})

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? icon,
}) {
  assert(title != null, 'NotificationSettings.title cannot be null');
  assert(body != null, 'NotificationSettings.body cannot be null');

  return NotificationSettings(
    title: title ?? this.title,
    body: body ?? this.body,
    stopButton: stopButton ?? this.stopButton,
    icon: icon ?? this.icon,
  );
}