In preperation for upcoming room screens.
RoomInfo is supposed to be used in conjunction with
the Room class.
They are not merged (Room as a attribut in RoomInfo),
because whilst Room can be stored on disk,
RoomInfo can not.
This is done to prevent tampering with the data
(when offline).
This also makes hiding elements easier when the user is offline,
as we can just pretend, that they do not have the required permission.
Done in preperations for rooms,
and the ability to edit rooms.
Will later be used to hide/show certain elements,
when the user does not meet the criteria
(permissions / admin / owner)
This has been done in an effort
to move all endpoints used to join a room
under one umbrella (/add-room)
A list of planned or completed endpoints:
- /add-room
- /add-room/new
- /add-room/by-id
NOTE: If the user is already in a public room,
the room will not be shown in the list.
NOTE: The search funtionality
has not been implemented yet.
NOTE: The join invite-only room screen
will be part of a later commit.
But the endpoint has already been set to
/add-room/by-id
Work already done:
- moving the New Room screen to a different endpoint
- fetching public rooms using the post API
- displaying public rooms
Suggestion for user interaction:
1. click on room
2. open bottomSheet with information and join button
3. click "join" to join room
If the room was created successfully,
the wizard automatically saves the room data on disk.
This allows it to be cached,
even if the user loses internet connection
right before the wizard exists.
That way the room will be cached.
NOTE: Might be a good idea to move the title down,
if no description is available.
If ListTile does not support such feature,
maybe using an alternative might be good idea
This is prevents the current route from being reset,
when reloading the tab
and also prevents the welcome screen from showing
(when running on slow connections)
NOTE: This also means that the home screen will be loaded
even if the client has never been logged in.
This means that some functions might return null