copyWith method

NotificationSettingsEntity copyWith({
  1. bool? isEnabled,
  2. bool? allowSound,
  3. bool? allowVibration,
  4. bool? allowLights,
  5. bool? allowBadge,
  6. String? soundPath,
  7. List<int>? vibrationPattern,
  8. bool? quietHoursEnabled,
  9. TimeOfDay? quietHoursStart,
  10. TimeOfDay? quietHoursEnd,
  11. Map<String, NotificationChannelSettings>? channels,
  12. Map<String, NotificationGroupSettings>? groupSettings,
})

Creates a copy of this settings entity with updated fields.

Implementation

NotificationSettingsEntity copyWith({
  bool? isEnabled,
  bool? allowSound,
  bool? allowVibration,
  bool? allowLights,
  bool? allowBadge,
  String? soundPath,
  List<int>? vibrationPattern,
  bool? quietHoursEnabled,
  TimeOfDay? quietHoursStart,
  TimeOfDay? quietHoursEnd,
  Map<String, NotificationChannelSettings>? channels,
  Map<String, NotificationGroupSettings>? groupSettings,
}) {
  return NotificationSettingsEntity(
    isEnabled: isEnabled ?? this.isEnabled,
    allowSound: allowSound ?? this.allowSound,
    allowVibration: allowVibration ?? this.allowVibration,
    allowLights: allowLights ?? this.allowLights,
    allowBadge: allowBadge ?? this.allowBadge,
    soundPath: soundPath ?? this.soundPath,
    vibrationPattern: vibrationPattern ?? this.vibrationPattern,
    quietHoursEnabled: quietHoursEnabled ?? this.quietHoursEnabled,
    quietHoursStart: quietHoursStart ?? this.quietHoursStart,
    quietHoursEnd: quietHoursEnd ?? this.quietHoursEnd,
    channels: channels ?? this.channels,
    groupSettings: groupSettings ?? this.groupSettings,
  );
}