copyWith abstract method

Room copyWith({
  1. int? createdAt,
  2. String? id,
  3. String? imageUrl,
  4. List<Message>? lastMessages,
  5. Map<String, dynamic>? metadata,
  6. String? name,
  7. RoomType? type,
  8. int? updatedAt,
  9. List<User>? users,
})

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,
});