getRoomById method

Room? getRoomById(
  1. String id
)

Searches in the local cache for the given room and returns null if not found. If you have loaded the loadArchive() before, it can also return archived rooms.

Implementation

Room? getRoomById(String id) {
  for (final room in <Room>[...rooms, ..._archivedRooms.map((e) => e.room)]) {
    if (room.id == id) return room;
  }

  return null;
}