copyWith method

ChatFolder copyWith({
  1. ChatFolderName? name,
  2. ChatFolderIcon? icon()?,
  3. int? colorId,
  4. bool? isShareable,
  5. List<int>? pinnedChatIds,
  6. List<int>? includedChatIds,
  7. List<int>? excludedChatIds,
  8. bool? excludeMuted,
  9. bool? excludeRead,
  10. bool? excludeArchived,
  11. bool? includeContacts,
  12. bool? includeNonContacts,
  13. bool? includeBots,
  14. bool? includeGroups,
  15. bool? includeChannels,
  16. dynamic extra,
  17. int? clientId,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

ChatFolder copyWith({
  ChatFolderName? name,
  ChatFolderIcon? Function()? icon,
  int? colorId,
  bool? isShareable,
  List<int>? pinnedChatIds,
  List<int>? includedChatIds,
  List<int>? excludedChatIds,
  bool? excludeMuted,
  bool? excludeRead,
  bool? excludeArchived,
  bool? includeContacts,
  bool? includeNonContacts,
  bool? includeBots,
  bool? includeGroups,
  bool? includeChannels,
  dynamic extra,
  int? clientId,
}) => ChatFolder(
  name: name ?? this.name,
  icon: icon != null ? icon() : this.icon,
  colorId: colorId ?? this.colorId,
  isShareable: isShareable ?? this.isShareable,
  pinnedChatIds: pinnedChatIds ?? this.pinnedChatIds,
  includedChatIds: includedChatIds ?? this.includedChatIds,
  excludedChatIds: excludedChatIds ?? this.excludedChatIds,
  excludeMuted: excludeMuted ?? this.excludeMuted,
  excludeRead: excludeRead ?? this.excludeRead,
  excludeArchived: excludeArchived ?? this.excludeArchived,
  includeContacts: includeContacts ?? this.includeContacts,
  includeNonContacts: includeNonContacts ?? this.includeNonContacts,
  includeBots: includeBots ?? this.includeBots,
  includeGroups: includeGroups ?? this.includeGroups,
  includeChannels: includeChannels ?? this.includeChannels,
  extra: extra ?? this.extra,
  clientId: clientId ?? this.clientId,
);