copyWith method
UserPreferencesModel
copyWith({
- bool? globalNotificationsEnabled,
- bool? soundEnabled,
- bool? vibrationEnabled,
- bool? badgeEnabled,
- NotificationAlertStyle? alertStyle,
- bool? showPreviews,
- bool? groupNotifications,
- bool? notificationHistory,
- bool? criticalAlertsEnabled,
- bool? scheduledDelivery,
- QuietHoursSettings? quietHours,
- Map<
String, CategoryPreference> ? categoryPreferences, - List<
String> ? blockedSenders, - List<
String> ? allowedSenders, - DateTime? lastUpdated,
Creates a copy of these preferences with updated fields.
Implementation
UserPreferencesModel copyWith({
bool? globalNotificationsEnabled,
bool? soundEnabled,
bool? vibrationEnabled,
bool? badgeEnabled,
NotificationAlertStyle? alertStyle,
bool? showPreviews,
bool? groupNotifications,
bool? notificationHistory,
bool? criticalAlertsEnabled,
bool? scheduledDelivery,
QuietHoursSettings? quietHours,
Map<String, CategoryPreference>? categoryPreferences,
List<String>? blockedSenders,
List<String>? allowedSenders,
DateTime? lastUpdated,
}) {
return UserPreferencesModel(
globalNotificationsEnabled:
globalNotificationsEnabled ?? this.globalNotificationsEnabled,
soundEnabled: soundEnabled ?? this.soundEnabled,
vibrationEnabled: vibrationEnabled ?? this.vibrationEnabled,
badgeEnabled: badgeEnabled ?? this.badgeEnabled,
alertStyle: alertStyle ?? this.alertStyle,
showPreviews: showPreviews ?? this.showPreviews,
groupNotifications: groupNotifications ?? this.groupNotifications,
notificationHistory: notificationHistory ?? this.notificationHistory,
criticalAlertsEnabled:
criticalAlertsEnabled ?? this.criticalAlertsEnabled,
scheduledDelivery: scheduledDelivery ?? this.scheduledDelivery,
quietHours: quietHours ?? this.quietHours,
categoryPreferences: categoryPreferences ?? this.categoryPreferences,
blockedSenders: blockedSenders ?? this.blockedSenders,
allowedSenders: allowedSenders ?? this.allowedSenders,
lastUpdated: lastUpdated ?? this.lastUpdated,
);
}