Added:
- changePassword to change the password
NOTE: this requires the old password,
just to prevent account hijacking.
- some basic user limit information
- theme selector
NOTE: the system theme is meant to function like auto-theme,
and is directly translated into a flutter ThemeMode,
however, this does not appear to be working on the web.
This commit also adds the logout and delete account buttons,
but they do not yet delete all rooms,
nor do they properly logout the user.
BUG: User is not logged out correctly,
reloading the page fixes this.
Maybe localstore.listen does not detect deletion?
The screen allows the user to change the default permission set,
that applies to every member (but not the owner nor the admins).
This screen is only accessible by the owner,
admins or members with the changeAdmin permission.
The screen allows every room member,
to view a list of other room members,
and their role (Owner, Admin or Member).
If the user is allowed
(Owner, Admin, changeAdmin/manageMembers),
to either kick or promote members to the admin role,
the list tile will have a tap event.
NOTE: This is why some members do not have a hover animation.
For example the owner cannot be kicked.
Added SingleChildScrollView to new-room, edit-room
and the about-room tab.
NOTE: Added a padding to the new and edit room pages,
to prevent widgets from touching the screen bottom
FIXES: Bug where signup, signin,
edit room and new room screen would fail to open,
because the Flexible Widget cannot be nested in a
Centered Widget.
NOTE: Turns out the widget was not neccessary at all
Data-fetch routine:
fetch room information from server
-> if unsuccessfull load room from disk
The room will automatically be closed,
if either of the following conditions apply:
- the user is offline and no data was found on disk
- the network request returned a server error
and rewrote the component's network requests.
showSimpleSnackbar, allows displaying a simple snackbar,
with text and one action button, that can be clicked.
doNetworkRequest is supposed to be a wrapper for the
already existing post* functions.
It aims to make network requests and error handling easier,
by containing all the try&catch blocks
and being able to show snackbars.
NOTE: Only the room owner can delete a room,
but they are not able to leave the room.
BUG: Deleting or leaving the room deletes the room from disk,
but for an unknown reason, the homescreen does not update
and still shows the room.
Opening and closing the room seems to cause the homescreen to
update, removing the room.
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