Closed bdmendes closed 8 months ago
An API I thought for this was
FacultyFilter(
faculties: ["feup", "fmup"],
build: (context, authorizedFaculties) => FacultyMap(...)
)
There are a few aspects that I think make this proposal good:
build
function prevents the initState
function or the constructor of the FacultyMap
widget being called unless the user is of a faculty that is on the list.authorizedFaculties
, the list of the faculties that are both in the user's faculty list and on the filter faculties
, allows us to, inside the authorized widget, make decisions about what to show the user.FacultyFilter
s inside other FacultyFilter
s and multiple FacultyFilter
in the same page. We can also have FacultyFilter
s on the navbar.The FacultyFilter
would get the user's faculties from a provider.
Since the new navbar/nav schema, the old page hide mechanism is now useless. Study factory/conditional rendering for faculty-specific data.