EventListBloc
Component Detail
Description
BLoC that manages state for the event listing screen, coordinating between the local Drift database and the remote REST API. It enforces role-based visibility so peer mentors receive only association-scoped events while coordinators receive all events within their scope. It handles filter logic, background refresh scheduling, and error propagation to the UI layer.
event-list-bloc
Sources & reasoning
The core navigation description (lines 289-296) includes an event wizard in the Add modal, implying events are a first-class entity in the MVP app. A creation flow without a corresponding list view would be unusable; the blueprint confirms [MVP] for Event Listing. The listing is a structural prerequisite for coordinator oversight and statistical visibility described across all organisations.
-
docs/source/likeperson.md ยท line 289-296Bottom nav with 5 tabs: Home, Contacts, Add (modal launcher for Activity and Event wizards), Work, Notifications โฆ Event wizard (multi-step: title โ date โ time โ duration โ location โ summary)
Responsibilities
- Load events from the local Drift database and emit cached state immediately on initialisation
- Trigger background REST API refresh and merge remote results into local storage
- Apply date-range and status filters to the event stream before emitting updated state
- Enforce role-based scoping by filtering events according to the authenticated user's role and organisation context
- Emit loading, loaded, empty, and error states for consumption by EventListScreen
Interfaces
EventListBloc(EventRepository, AuthRepository): EventListBloc
add(EventListEvent): void
stream: Stream<EventListState>
loadEvents(filters: EventFilters): Future<void>
refresh(): Future<void>
Related Data Entities (2)
Data entities managed by this component