copyWith method
Message
copyWith({
- Map<
String, dynamic> ? metadata, - PreviewData? previewData,
- Status? status,
- String? text,
- int? updatedAt,
override
Creates a copy of the file message with an updated data.
metadata
with null value will nullify existing metadata, otherwise
both metadatas will be merged into one Map, where keys from a passed
metadata will overwite keys from the previous one.
previewData
is ignored for this message type.
status
with null value will be overwritten by the previous status.
text
is ignored for this message type.
updatedAt
with null value will nullify existing value.
Implementation
@override
Message copyWith({
Map<String, dynamic>? metadata,
PreviewData? previewData,
Status? status,
String? text,
int? updatedAt,
}) {
return FileMessage(
author: author,
createdAt: createdAt,
id: id,
metadata: metadata == null
? null
: {
...this.metadata ?? {},
...metadata,
},
mimeType: mimeType,
name: name,
roomId: roomId,
size: size,
status: status ?? this.status,
updatedAt: updatedAt,
uri: uri,
);
}