copyWith abstract method
Creates a copy of the room with an updated data.
imageUrl, name and updatedAt with null values will nullify existing values
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.
type and users with null values will be overwritten by previous values.
Implementation
Room copyWith({
int? createdAt,
String? id,
String? imageUrl,
List<Message>? lastMessages,
Map<String, dynamic>? metadata,
String? name,
RoomType? type,
int? updatedAt,
List<User>? users,
});