copyWith method

ChatReplySnapshot copyWith({
  1. String? messageId,
  2. String? authorId,
  3. String? authorDisplayName,
  4. String? authorAvatarUrl,
  5. String? textPreview,
  6. DateTime? createdAt,
})

Creates a copy of this snapshot with the given fields replaced with new values.

All fields are optional. If a field is not provided, the original value is kept.

Implementation

ChatReplySnapshot copyWith({
  String? messageId,
  String? authorId,
  String? authorDisplayName,
  String? authorAvatarUrl,
  String? textPreview,
  DateTime? createdAt,
}) {
  return ChatReplySnapshot(
    messageId: messageId ?? this.messageId,
    authorId: authorId ?? this.authorId,
    authorDisplayName: authorDisplayName ?? this.authorDisplayName,
    authorAvatarUrl: authorAvatarUrl ?? this.authorAvatarUrl,
    textPreview: textPreview ?? this.textPreview,
    createdAt: createdAt ?? this.createdAt,
  );
}