Dashboard Cache Store
Component Detail
Data Layer
low complexity
mobile
0
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
Local SQLite-backed store that persists the last-known dashboard state per role, enabling immediate screen render on cold start before API data arrives. Stores serialized BLoC state snapshots keyed by user ID and role, with TTL-based invalidation to prevent stale data from persisting indefinitely.
dashboard-cache-store
Responsibilities
- Persist last-known dashboard state snapshot per user and role
- Serve cached state immediately on screen mount for stale-while-revalidate
- Invalidate cache entries based on configurable TTL
- Clear cache on logout or role switch
Interfaces
saveDashboardSnapshot(String userId, UserRole role, DashboardState state)
loadDashboardSnapshot(String userId, UserRole role)
invalidateSnapshot(String userId, UserRole role)
clearAllForUser(String userId)
isCacheValid(String userId, UserRole role)
getSnapshotAge(String userId, UserRole role)