SwEnt-Group13 / Unio

The world’s largest campus life platform.
3 stars 1 forks source link

Implement usage of argument for the association profile screen #60

Closed Zafouche closed 1 week ago

Zafouche commented 1 week ago

The idea is the following: When we click on an association in the explore page, then it takes us to the profile screen of the association. Instead of keeping a state variable that would be kept in a view model, we could directly pass either the whole data or the UID of the association as an argument to the association profile screen. See this article

Need to consider as well storing a state flow in the association model. This wouldn't be too bad since the view model can be instantiated through the Factory way, which wouldn't require us to pass the view model as an argument to every other composable instantiation that would need it.

oskar-codes commented 1 week ago

Great initiative Zafar! This is an issue that needs to be addressed.

Just so you know, I’ve read that passing entire objects as parameters of routes is bad practice, and only String UIDs should be passed.

Zafouche commented 1 week ago

Great initiative Zafar! This is an issue that needs to be addressed.

Just so you know, I’ve read that passing entire objects as parameters of routes is bad practice, and only String UIDs should be passed.

Yes, that's what I was planning to do. Then, the association profile screen can simply use the view model to get the object from its list.