copyWith method
DirectMessage
copyWith({
- int? id,
- String? textContent,
- String? deltaContent,
- int? group,
- String? fromUserFullName,
- int? fromUserId,
- dynamic replyTo,
- bool? isBase64Encoded,
- int? createdAt,
- dynamic updatedAt,
- dynamic forwardedByUser,
- dynamic forwardedFromGroup,
- List? seenBy,
- List<
MessageFile> ? files, - List? replies,
- Reactions? reactions,
- int? hash,
- bool? isDeleted,
- bool? isPinned,
Implementation
DirectMessage copyWith({
int? id,
String? textContent,
String? deltaContent,
int? group,
String? fromUserFullName,
int? fromUserId,
dynamic replyTo,
bool? isBase64Encoded,
int? createdAt,
dynamic updatedAt,
dynamic forwardedByUser,
dynamic forwardedFromGroup,
List<dynamic>? seenBy,
List<MessageFile>? files, // ✅ Changed type
List<dynamic>? replies,
Reactions? reactions,
int? hash,
bool? isDeleted,
bool? isPinned,
}) {
return DirectMessage(
id: id ?? this.id,
textContent: textContent ?? this.textContent,
deltaContent: deltaContent ?? this.deltaContent,
group: group ?? this.group,
fromUserFullName: fromUserFullName ?? this.fromUserFullName,
fromUserId: fromUserId ?? this.fromUserId,
replyTo: replyTo ?? this.replyTo,
isBase64Encoded: isBase64Encoded ?? this.isBase64Encoded,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
forwardedByUser: forwardedByUser ?? this.forwardedByUser,
forwardedFromGroup: forwardedFromGroup ?? this.forwardedFromGroup,
seenBy: seenBy ?? this.seenBy,
files: files ?? this.files,
replies: replies ?? this.replies,
reactions: reactions ?? this.reactions,
hash: hash ?? this.hash,
isDeleted: isDeleted ?? this.isDeleted,
isPinned: isPinned ?? this.isPinned,
);
}