presentation/providers/providers library

Classes

Chat
ChatFamily
See also Chat.
ChatMessage
ChatParams
Parameters for identifying a chat session.
ChatProvider
See also Chat.
ChatState
CurriculumLevelsFamily
See also curriculumLevels.
CurriculumLevelsProvider
See also curriculumLevels.
DomainBySlugFamily
Resolve a domain slug to its entity from the already-loaded domains list.
DomainBySlugProvider
Resolve a domain slug to its entity from the already-loaded domains list.
DomainProgressFamily
Map of topicId -> mastery level string for all topics in a domain.
DomainProgressProvider
Map of topicId -> mastery level string for all topics in a domain.
DueTodayItem
Minimal value object for the Home "Due today" inline list. Joins a review card with its topic title + domain slug + human domain name so DueTodayCard can render without further lookups.
MasteryOverridesFamily
See also masteryOverrides.
MasteryOverridesProvider
See also masteryOverrides.
Milestone
One row in _MilestonesList. Synthesised from progress + streak data; not a stored entity. The tone is a visual hint for the trailing pill.
ReadingQuestionsFamily
Reading questions for active reading in the lesson viewer.
ReadingQuestionsProvider
Reading questions for active reading in the lesson viewer.
RecommendedStep
ReviewSummariesForDomainFamily
Map of topicId -> longest interval + due flag for review cards in a domain. Topics with no cards are absent from the map.
ReviewSummariesForDomainProvider
Map of topicId -> longest interval + due flag for review cards in a domain. Topics with no cards are absent from the map.
TopicChunksFamily
See also topicChunks.
TopicChunksProvider
See also topicChunks.
TopicIdsWithContentFamily
See also topicIdsWithContent.
TopicIdsWithContentProvider
See also topicIdsWithContent.
TopicNameFamily
Resolve a topic's title by ID (used as fallback when title isn't passed via route).
TopicNameProvider
Resolve a topic's title by ID (used as fallback when title isn't passed via route).
TopicNotesFamily
See also topicNotes.
TopicNotesProvider
See also topicNotes.
TopicProgressFamily
Single topic progress (used by lesson viewer to show read state).
TopicProgressProvider
Single topic progress (used by lesson viewer to show read state).
TopicTreeFamily
See also topicTree.
TopicTreeProvider
See also topicTree.

Enums

MilestoneTone
Tone applied to a milestone pill — picked by mastery transition or streak event. forest for mastery/evaluation jumps, ochre for streak or retention milestones, plum for evaluation entries.

Mixins

ChatRef
CurriculumLevelsRef
DomainBySlugRef
DomainProgressRef
MasteryOverridesRef
ReadingQuestionsRef
ReviewSummariesForDomainRef
TopicChunksRef
TopicIdsWithContentRef
TopicNameRef
TopicNotesRef
TopicProgressRef
TopicTreeRef

Constants

chatProvider → const ChatFamily
See also Chat.
curriculumLevelsProvider → const CurriculumLevelsFamily
See also curriculumLevels.
domainBySlugProvider → const DomainBySlugFamily
Resolve a domain slug to its entity from the already-loaded domains list.
domainProgressProvider → const DomainProgressFamily
Map of topicId -> mastery level string for all topics in a domain.
masteryOverridesProvider → const MasteryOverridesFamily
See also masteryOverrides.
readingQuestionsProvider → const ReadingQuestionsFamily
Reading questions for active reading in the lesson viewer.
reviewSummariesForDomainProvider → const ReviewSummariesForDomainFamily
Map of topicId -> longest interval + due flag for review cards in a domain. Topics with no cards are absent from the map.
topicChunksProvider → const TopicChunksFamily
See also topicChunks.
topicIdsWithContentProvider → const TopicIdsWithContentFamily
See also topicIdsWithContent.
topicNameProvider → const TopicNameFamily
Resolve a topic's title by ID (used as fallback when title isn't passed via route).
topicNotesProvider → const TopicNotesFamily
See also topicNotes.
topicProgressProvider → const TopicProgressFamily
Single topic progress (used by lesson viewer to show read state).
topicTreeProvider → const TopicTreeFamily
See also topicTree.

Properties

aiDatasourceProvider Provider<AiDatasource>
The active AI datasource, based on the user's selected provider.
final
allProgressProvider AutoDisposeFutureProvider<List<UserTopicProgressModel>>
All progress rows for the current user (used by progress dashboard).
final
chunkSyncServiceProvider Provider<ChunkSyncService?>
See also chunkSyncService.
final
contentRetrieverProvider Provider<ContentRetriever>
See also contentRetriever.
final
domainIdsWithContentProvider AutoDisposeFutureProvider<Set<String>>
Set of domain IDs that have at least one topic with content. Powers the goal-creation domain filter and the "no topics available" warning on goal cards whose linked domain has no studyable content.
final
domainsProvider AutoDisposeFutureProvider<List<DomainEntity>>
See also domains.
final
dueCardsProvider AutoDisposeFutureProvider<List<ReviewCard>>
See also dueCards.
final
dueTodayItemsProvider AutoDisposeFutureProvider<List<DueTodayItem>>
Joined view of due cards with their topic + domain metadata. Keeps the join in one place so the Home screen widget tree stays presentational. Topics are batch-fetched in a single round-trip (was N+1 by topic).
final
goalsProvider AutoDisposeFutureProvider<List<LearningGoal>>
See also goals.
final
googleAuthServiceProvider Provider<GoogleAuthService>
See also googleAuthService.
final
localEmbeddingProvider Provider<LocalEmbeddingDatasource?>
See also localEmbedding.
final
localLlmProvider Provider<LocalLlmDatasource?>
On-device LLM inference (llama.cpp via llama_cpp_dart). null on web — there's no isolate / dart:io / GGUF runtime in the browser. Also null when the feature flag EnvConfig.enableLocalLlm is off, which hides the provider from users while keeping the implementation in the tree. On native with the flag on, isConfigured() returns false until the user downloads + activates a model in AI settings, so chat sessions cleanly skip the local provider when nothing is installed.
final
localVectorStoreProvider Provider<LocalVectorStore?>
See also localVectorStore.
final
masteryCompositionProvider AutoDisposeFutureProvider<Map<int, int>>
Topic count grouped by mastery level (0..5). Drives the stacked bar in _MasteryCompositionPanel. Level 0 = unstarted, 1 = awareness, 2 = understanding, 3 = application, 4 = evaluation, 5 = mastery.
final
myCurriculumDomainsProvider AutoDisposeFutureProvider<List<DomainEntity>>
Domains the user has personal access to: owned + shared + assigned (via curriculum_assignments). Does NOT include public-visibility domains the user hasn't engaged with. Used by progress-focused screens (home card, progress dashboard, domain browse) so "no curriculum" means "no domains shown".
final
myDomainsProvider AutoDisposeFutureProvider<List<DomainEntity>>
See also myDomains.
final
nextReviewDateProvider AutoDisposeFutureProvider<DateTime?>
See also nextReviewDate.
final
notesCountProvider AutoDisposeFutureProvider<int>
See also notesCount.
final
offlineOutboxProvider Provider<OfflineOutbox?>
Append-only queue of pending Supabase writes that the device couldn't flush online. null on web (no sqlite3 / dart:io). Initialized lazily — callers must await initialize() before use; eager-init at app startup is a future polish (see riverpod-eager-initialization).
final
openAiAuthServiceProvider Provider<OpenAiAuthService>
Auth service providers for OAuth-based AI providers.
final
outboxedWritesProvider Provider<OutboxedWrites>
Helper that funnels Supabase writes through the OfflineOutbox. On web (no outbox), it falls through to direct Supabase calls. Screens and notifiers can write through this without re-implementing the enqueue / call / mark-synced dance per call site.
final
preferredVariantsProvider AutoDisposeFutureProvider<Map<String, String>>
Preferred curriculum variant per domain family, persisted in profiles.settings.
final
recentMilestonesProvider AutoDisposeFutureProvider<List<Milestone>>
Up to 6 most recent advancement events derived from allProgressProvider. Heuristic: pick the latest progress rows with non-unstarted mastery, sorted by lastStudiedAt (or updatedAt) descending. Topic titles are resolved on the fly via getTopicById. If a streak ≥ 10 falls inside the window it's added as an extra ochre milestone at the head.
final
recentSessionsProvider AutoDisposeFutureProvider<List<LearningSession>>
See also recentSessions.
final
recommendedNextStepProvider AutoDisposeFutureProvider<RecommendedStep?>
See also recommendedNextStep.
final
secureStorageProvider Provider<FlutterSecureStorage>
See also secureStorage.
final
selectedAiProviderProvider AutoDisposeFutureProvider<AiProvider>
Which AI provider the user has selected. Reads from Supabase if the user has consented to cloud sync; otherwise reads from local secure storage.
final
sharedWithMeProvider AutoDisposeFutureProvider<List<DomainEntity>>
See also sharedWithMe.
final
supabaseDatasourceProvider Provider<SupabaseDatasource> Providers
Root SupabaseDatasource singleton. Every screen/provider that reads Supabase data watches this provider — it's the one-and-only instance wired to Supabase.instance.client. Kept alive for the app lifetime.
final
syncWorkerProvider Provider<SyncWorker?>
Background drain worker that replays the OfflineOutbox into Supabase on every online tick from isOnlineProvider. null on web.
final
totalCardCountProvider AutoDisposeFutureProvider<int>
See also totalCardCount.
final
useAiProxyProvider AutoDisposeFutureProvider<bool>
Whether the AI proxy is enabled (routes calls through Supabase Edge Function).
final
userAiSettingsDatasourceProvider Provider<UserAiSettingsDatasource>
Supabase-backed source of truth for the user's AI provider settings. Synced across devices once the user accepts the cloud-sync disclaimer (see AiSyncConsentDialog). FlutterSecureStorage caches the same values locally for offline use.
final
userNotesProvider AutoDisposeFutureProvider<List<UserNote>>
See also userNotes.
final
userPersonaProvider AutoDisposeFutureProvider<String?>
User persona ('solo' or 'team_lead'), persisted in profiles.settings. Null means the user hasn't chosen yet (triggers persona selection).
final
weeklyHeatmapProvider AutoDisposeFutureProvider<List<int>>
26-week × 7-day activity grid (182 buckets, oldest first). Each entry is a 0..4 intensity bucket derived from session count for that calendar day. The grid is laid out column-major: index = weekIndex * 7 + dayOfWeek, with dayOfWeek == 0 Monday and weekIndex == 25 the current week.
final

Functions

aiDatasource(Ref<Object?> ref) AiDatasource
The active AI datasource, based on the user's selected provider.
allProgress(Ref<Object?> ref) Future<List<UserTopicProgressModel>>
All progress rows for the current user (used by progress dashboard).
chunkSyncService(Ref<Object?> ref) ChunkSyncService?
contentRetriever(Ref<Object?> ref) ContentRetriever
curriculumLevels(Ref<Object?> ref, String domainId) Future<List<CurriculumLevel>>
domainBySlug(Ref<Object?> ref, String slug) DomainEntity?
Resolve a domain slug to its entity from the already-loaded domains list.
domainIdsWithContent(Ref<Object?> ref) Future<Set<String>>
Set of domain IDs that have at least one topic with content. Powers the goal-creation domain filter and the "no topics available" warning on goal cards whose linked domain has no studyable content.
domainProgress(Ref<Object?> ref, String domainId) Future<Map<String, String>>
Map of topicId -> mastery level string for all topics in a domain.
domains(Ref<Object?> ref) Future<List<DomainEntity>>
dueCards(Ref<Object?> ref) Future<List<ReviewCard>>
dueTodayItems(Ref<Object?> ref) Future<List<DueTodayItem>>
Joined view of due cards with their topic + domain metadata. Keeps the join in one place so the Home screen widget tree stays presentational. Topics are batch-fetched in a single round-trip (was N+1 by topic).
getProviderCredential(Ref<Object?> ref, AiProvider provider) Future<String?>
Read the user's credential for the given provider. API key for Claude, OAuth access token for OpenAI/Gemini, active model ID for local (functions as the "credential" the proxy/datasource needs to load the correct GGUF — though local never goes through the proxy).
goals(Ref<Object?> ref) Future<List<LearningGoal>>
googleAuthService(Ref<Object?> ref) GoogleAuthService
localEmbedding(Ref<Object?> ref) LocalEmbeddingDatasource?
localLlm(Ref<Object?> ref) LocalLlmDatasource?
On-device LLM inference (llama.cpp via llama_cpp_dart). null on web — there's no isolate / dart:io / GGUF runtime in the browser. Also null when the feature flag EnvConfig.enableLocalLlm is off, which hides the provider from users while keeping the implementation in the tree. On native with the flag on, isConfigured() returns false until the user downloads + activates a model in AI settings, so chat sessions cleanly skip the local provider when nothing is installed.
localVectorStore(Ref<Object?> ref) LocalVectorStore?
masteryComposition(Ref<Object?> ref) Future<Map<int, int>>
Topic count grouped by mastery level (0..5). Drives the stacked bar in _MasteryCompositionPanel. Level 0 = unstarted, 1 = awareness, 2 = understanding, 3 = application, 4 = evaluation, 5 = mastery.
masteryLevelFromString(String mastery) int
Translates the mastery string used across the app into a 0..5 level. Public so the dashboard widgets can reuse it without redefining the map.
masteryOverrides(Ref<Object?> ref, String? topicId) Future<List<MasteryOverride>>
myCurriculumDomains(Ref<Object?> ref) Future<List<DomainEntity>>
Domains the user has personal access to: owned + shared + assigned (via curriculum_assignments). Does NOT include public-visibility domains the user hasn't engaged with. Used by progress-focused screens (home card, progress dashboard, domain browse) so "no curriculum" means "no domains shown".
myDomains(Ref<Object?> ref) Future<List<DomainEntity>>
nextReviewDate(Ref<Object?> ref) Future<DateTime?>
notesCount(Ref<Object?> ref) Future<int>
offlineOutbox(Ref<Object?> ref) OfflineOutbox?
Append-only queue of pending Supabase writes that the device couldn't flush online. null on web (no sqlite3 / dart:io). Initialized lazily — callers must await initialize() before use; eager-init at app startup is a future polish (see riverpod-eager-initialization).
openAiAuthService(Ref<Object?> ref) OpenAiAuthService
Auth service providers for OAuth-based AI providers.
outboxedWrites(Ref<Object?> ref) OutboxedWrites
Helper that funnels Supabase writes through the OfflineOutbox. On web (no outbox), it falls through to direct Supabase calls. Screens and notifiers can write through this without re-implementing the enqueue / call / mark-synced dance per call site.
preferredVariants(Ref<Object?> ref) Future<Map<String, String>>
Preferred curriculum variant per domain family, persisted in profiles.settings.
readingQuestions(Ref<Object?> ref, String topicId) Future<List<ReadingQuestion>>
Reading questions for active reading in the lesson viewer.
recentMilestones(Ref<Object?> ref) Future<List<Milestone>>
Up to 6 most recent advancement events derived from allProgressProvider. Heuristic: pick the latest progress rows with non-unstarted mastery, sorted by lastStudiedAt (or updatedAt) descending. Topic titles are resolved on the fly via getTopicById. If a streak ≥ 10 falls inside the window it's added as an extra ochre milestone at the head.
recentSessions(Ref<Object?> ref) Future<List<LearningSession>>
recommendedNextStep(Ref<Object?> ref) Future<RecommendedStep?>
reviewSummariesForDomain(Ref<Object?> ref, String domainId) Future<Map<String, ({bool due, int? intervalDays})>>
Map of topicId -> longest interval + due flag for review cards in a domain. Topics with no cards are absent from the map.
secureStorage(Ref<Object?> ref) FlutterSecureStorage
selectedAiProvider(Ref<Object?> ref) Future<AiProvider>
Which AI provider the user has selected. Reads from Supabase if the user has consented to cloud sync; otherwise reads from local secure storage.
sharedWithMe(Ref<Object?> ref) Future<List<DomainEntity>>
supabaseDatasource(Ref<Object?> ref) SupabaseDatasource Providers
Root SupabaseDatasource singleton. Every screen/provider that reads Supabase data watches this provider — it's the one-and-only instance wired to Supabase.instance.client. Kept alive for the app lifetime.
syncWorker(Ref<Object?> ref) SyncWorker?
Background drain worker that replays the OfflineOutbox into Supabase on every online tick from isOnlineProvider. null on web.
topicChunks(Ref<Object?> ref, String topicId) Future<List<ContentChunk>>
topicIdsWithContent(Ref<Object?> ref, String domainId) Future<Set<String>>
topicName(Ref<Object?> ref, String topicId) Future<String?>
Resolve a topic's title by ID (used as fallback when title isn't passed via route).
topicNotes(Ref<Object?> ref, String topicId) Future<List<UserNote>>
topicProgress(Ref<Object?> ref, String topicId) Future<UserTopicProgressModel?>
Single topic progress (used by lesson viewer to show read state).
topicTree(Ref<Object?> ref, String domainId) Future<List<Topic>>
totalCardCount(Ref<Object?> ref) Future<int>
useAiProxy(Ref<Object?> ref) Future<bool>
Whether the AI proxy is enabled (routes calls through Supabase Edge Function).
userAiSettingsDatasource(Ref<Object?> ref) UserAiSettingsDatasource
Supabase-backed source of truth for the user's AI provider settings. Synced across devices once the user accepts the cloud-sync disclaimer (see AiSyncConsentDialog). FlutterSecureStorage caches the same values locally for offline use.
userNotes(Ref<Object?> ref) Future<List<UserNote>>
userPersona(Ref<Object?> ref) Future<String?>
User persona ('solo' or 'team_lead'), persisted in profiles.settings. Null means the user hasn't chosen yet (triggers persona selection).
weeklyHeatmap(Ref<Object?> ref) Future<List<int>>
26-week × 7-day activity grid (182 buckets, oldest first). Each entry is a 0..4 intensity bucket derived from session count for that calendar day. The grid is laid out column-major: index = weekIndex * 7 + dayOfWeek, with dayOfWeek == 0 Monday and weekIndex == 25 the current week.

Typedefs

AiDatasourceRef = ProviderRef<AiDatasource>
AllProgressRef = AutoDisposeFutureProviderRef<List<UserTopicProgressModel>>
ChunkSyncServiceRef = ProviderRef<ChunkSyncService?>
ContentRetrieverRef = ProviderRef<ContentRetriever>
DomainIdsWithContentRef = AutoDisposeFutureProviderRef<Set<String>>
DomainsRef = AutoDisposeFutureProviderRef<List<DomainEntity>>
DueCardsRef = AutoDisposeFutureProviderRef<List<ReviewCard>>
DueTodayItemsRef = AutoDisposeFutureProviderRef<List<DueTodayItem>>
GoalsRef = AutoDisposeFutureProviderRef<List<LearningGoal>>
GoogleAuthServiceRef = ProviderRef<GoogleAuthService>
LocalEmbeddingRef = ProviderRef<LocalEmbeddingDatasource?>
LocalLlmRef = ProviderRef<LocalLlmDatasource?>
LocalVectorStoreRef = ProviderRef<LocalVectorStore?>
MasteryCompositionRef = AutoDisposeFutureProviderRef<Map<int, int>>
MyCurriculumDomainsRef = AutoDisposeFutureProviderRef<List<DomainEntity>>
MyDomainsRef = AutoDisposeFutureProviderRef<List<DomainEntity>>
NextReviewDateRef = AutoDisposeFutureProviderRef<DateTime?>
NotesCountRef = AutoDisposeFutureProviderRef<int>
OfflineOutboxRef = ProviderRef<OfflineOutbox?>
OpenAiAuthServiceRef = ProviderRef<OpenAiAuthService>
OutboxedWritesRef = ProviderRef<OutboxedWrites>
PreferredVariantsRef = AutoDisposeFutureProviderRef<Map<String, String>>
RecentMilestonesRef = AutoDisposeFutureProviderRef<List<Milestone>>
RecentSessionsRef = AutoDisposeFutureProviderRef<List<LearningSession>>
RecommendedNextStepRef = AutoDisposeFutureProviderRef<RecommendedStep?>
SecureStorageRef = ProviderRef<FlutterSecureStorage>
SelectedAiProviderRef = AutoDisposeFutureProviderRef<AiProvider>
SharedWithMeRef = AutoDisposeFutureProviderRef<List<DomainEntity>>
SupabaseDatasourceRef = ProviderRef<SupabaseDatasource>
SyncWorkerRef = ProviderRef<SyncWorker?>
TotalCardCountRef = AutoDisposeFutureProviderRef<int>
UseAiProxyRef = AutoDisposeFutureProviderRef<bool>
UserAiSettingsDatasourceRef = ProviderRef<UserAiSettingsDatasource>
UserNotesRef = AutoDisposeFutureProviderRef<List<UserNote>>
UserPersonaRef = AutoDisposeFutureProviderRef<String?>
WeeklyHeatmapRef = AutoDisposeFutureProviderRef<List<int>>