presentation/providers/providers library

Classes

AiDatasourceProvider
The active AI datasource, based on the user's selected provider.
AllProgressProvider
All progress rows for the current user (used by progress dashboard).
Chat
ChatFamily
ChatMessage
ChatParams
Parameters for identifying a chat session.
ChatProvider
ChatState
ChunkSyncServiceProvider
ContentRetrieverProvider
CurriculumLevelsFamily
CurriculumLevelsProvider
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.
DomainIdsWithContentProvider
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.
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.
DomainsProvider
DueCardsProvider
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.
DueTodayItemsProvider
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).
EnrolledStartersProvider
Starter curricula the learner has actually added, as full entities.
GoalsProvider
GoogleAuthServiceProvider
LocalEmbeddingProvider
LocalLlmProvider
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.
LocalVectorStoreProvider
MasteryCompositionProvider
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.
MasteryOverridesFamily
MasteryOverridesProvider
Milestone
One row in _MilestonesList. Synthesised from progress + streak data; not a stored entity. The tone is a visual hint for the trailing pill.
MyCurriculumDomainsProvider
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".
MyDomainsProvider
NextReviewDateProvider
NotesCountProvider
OfflineOutboxProvider
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).
OpenAiAuthServiceProvider
Auth service providers for OAuth-based AI providers.
OutboxedWritesProvider
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.
PreferredVariantsProvider
Preferred curriculum variant per domain family, persisted in profiles.settings.
ReadingQuestionsFamily
Reading questions for active reading in the lesson viewer.
ReadingQuestionsProvider
Reading questions for active reading in the lesson viewer.
RecentMilestonesProvider
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.
RecentSessionsProvider
RecommendedNextStepProvider
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.
SecureStorageProvider
SelectedAiProviderProvider
Which AI provider the user has selected. Reads from Supabase if the user has consented to cloud sync; otherwise reads from local secure storage.
SharedWithMeProvider
StarterDomainsProvider
The curated starter catalog (migration 072). Starters are public by construction, so this resolves for a brand-new learner who owns nothing.
StarterEnrollmentIdsProvider
Ids of the starters the learner has opted into. Drives the catalog's added/not-added state and the library's inclusion filter.
SupabaseDatasourceProvider 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.
SyncWorkerProvider
Background drain worker that replays the OfflineOutbox into Supabase on every online tick from isOnlineProvider. null on web.
TopicChunksFamily
TopicChunksProvider
TopicIdsWithContentFamily
TopicIdsWithContentProvider
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
TopicNotesProvider
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
TopicTreeProvider
TotalCardCountProvider
UseAiProxyProvider
Whether the AI proxy is enabled (routes calls through Supabase Edge Function).
UserAiSettingsDatasourceProvider
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.
UserNotesProvider
UserPersonaProvider
User persona ('solo' or 'team_lead'), persisted in profiles.settings. Null means the user hasn't chosen yet (triggers persona selection).
WeeklyHeatmapProvider
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.

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.

Properties

aiDatasourceProvider → AiDatasourceProvider
The active AI datasource, based on the user's selected provider.
final
allProgressProvider → AllProgressProvider
All progress rows for the current user (used by progress dashboard).
final
chatProvider → ChatFamily
final
chunkSyncServiceProvider → ChunkSyncServiceProvider
final
contentRetrieverProvider → ContentRetrieverProvider
final
curriculumLevelsProvider → CurriculumLevelsFamily
final
domainBySlugProvider → DomainBySlugFamily
Resolve a domain slug to its entity from the already-loaded domains list.
final
domainIdsWithContentProvider → DomainIdsWithContentProvider
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
domainProgressProvider → DomainProgressFamily
Map of topicId -> mastery level string for all topics in a domain.
final
domainsProvider → DomainsProvider
final
dueCardsProvider → DueCardsProvider
final
dueTodayItemsProvider → DueTodayItemsProvider
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
enrolledStartersProvider → EnrolledStartersProvider
Starter curricula the learner has actually added, as full entities.
final
goalsProvider → GoalsProvider
final
googleAuthServiceProvider → GoogleAuthServiceProvider
final
localEmbeddingProvider → LocalEmbeddingProvider
final
localLlmProvider → LocalLlmProvider
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 → LocalVectorStoreProvider
final
masteryCompositionProvider → MasteryCompositionProvider
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
masteryOverridesProvider → MasteryOverridesFamily
final
myCurriculumDomainsProvider → MyCurriculumDomainsProvider
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 → MyDomainsProvider
final
nextReviewDateProvider → NextReviewDateProvider
final
notesCountProvider → NotesCountProvider
final
offlineOutboxProvider → OfflineOutboxProvider
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 → OpenAiAuthServiceProvider
Auth service providers for OAuth-based AI providers.
final
outboxedWritesProvider → OutboxedWritesProvider
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 → PreferredVariantsProvider
Preferred curriculum variant per domain family, persisted in profiles.settings.
final
readingQuestionsProvider → ReadingQuestionsFamily
Reading questions for active reading in the lesson viewer.
final
recentMilestonesProvider → RecentMilestonesProvider
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 → RecentSessionsProvider
final
recommendedNextStepProvider → RecommendedNextStepProvider
final
reviewSummariesForDomainProvider → ReviewSummariesForDomainFamily
Map of topicId -> longest interval + due flag for review cards in a domain. Topics with no cards are absent from the map.
final
secureStorageProvider → SecureStorageProvider
final
selectedAiProviderProvider → SelectedAiProviderProvider
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 → SharedWithMeProvider
final
starterDomainsProvider → StarterDomainsProvider
The curated starter catalog (migration 072). Starters are public by construction, so this resolves for a brand-new learner who owns nothing.
final
starterEnrollmentIdsProvider → StarterEnrollmentIdsProvider
Ids of the starters the learner has opted into. Drives the catalog's added/not-added state and the library's inclusion filter.
final
supabaseDatasourceProvider → SupabaseDatasourceProvider 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 → SyncWorkerProvider
Background drain worker that replays the OfflineOutbox into Supabase on every online tick from isOnlineProvider. null on web.
final
topicChunksProvider → TopicChunksFamily
final
topicIdsWithContentProvider → TopicIdsWithContentFamily
final
topicNameProvider → TopicNameFamily
Resolve a topic's title by ID (used as fallback when title isn't passed via route).
final
topicNotesProvider → TopicNotesFamily
final
topicProgressProvider → TopicProgressFamily
Single topic progress (used by lesson viewer to show read state).
final
topicTreeProvider → TopicTreeFamily
final
totalCardCountProvider → TotalCardCountProvider
final
useAiProxyProvider → UseAiProxyProvider
Whether the AI proxy is enabled (routes calls through Supabase Edge Function).
final
userAiSettingsDatasourceProvider → UserAiSettingsDatasourceProvider
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 → UserNotesProvider
final
userPersonaProvider → UserPersonaProvider
User persona ('solo' or 'team_lead'), persisted in profiles.settings. Null means the user hasn't chosen yet (triggers persona selection).
final
weeklyHeatmapProvider → WeeklyHeatmapProvider
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 ref) → AiDatasource
The active AI datasource, based on the user's selected provider.
allProgress(Ref ref) → Future<List<UserTopicProgressModel>>
All progress rows for the current user (used by progress dashboard).
chunkSyncService(Ref ref) → ChunkSyncService?
contentRetriever(Ref ref) → ContentRetriever
curriculumLevels(Ref ref, String domainId) → Future<List<CurriculumLevel>>
domainBySlug(Ref ref, String slug) → DomainEntity?
Resolve a domain slug to its entity from the already-loaded domains list.
domainIdsWithContent(Ref 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 ref, String domainId) → Future<Map<String, String>>
Map of topicId -> mastery level string for all topics in a domain.
domains(Ref ref) → Future<List<DomainEntity>>
dueCards(Ref ref) → Future<List<ReviewCard>>
dueTodayItems(Ref 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).
enrolledStarters(Ref ref) → Future<List<DomainEntity>>
Starter curricula the learner has actually added, as full entities.
getProviderCredential(Ref 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).
getProviderCredentialForWidget(WidgetRef ref, AiProvider provider) → Future<String?>
getProviderCredential for callers holding a WidgetRef rather than a Ref — a screen calling the proxy directly, as the curriculum import does. The two ref types share no supertype, so the read is passed in.
goals(Ref ref) → Future<List<LearningGoal>>
googleAuthService(Ref ref) → GoogleAuthService
localEmbedding(Ref ref) → LocalEmbeddingDatasource?
localLlm(Ref 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 ref) → LocalVectorStore?
masteryComposition(Ref 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 ref, String? topicId) → Future<List<MasteryOverride>>
myCurriculumDomains(Ref 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 ref) → Future<List<DomainEntity>>
nextReviewDate(Ref ref) → Future<DateTime?>
notesCount(Ref ref) → Future<int>
offlineOutbox(Ref 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 ref) → OpenAiAuthService
Auth service providers for OAuth-based AI providers.
outboxedWrites(Ref 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 ref) → Future<Map<String, String>>
Preferred curriculum variant per domain family, persisted in profiles.settings.
readingQuestions(Ref ref, String topicId) → Future<List<ReadingQuestion>>
Reading questions for active reading in the lesson viewer.
recentMilestones(Ref 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 ref) → Future<List<LearningSession>>
recommendedNextStep(Ref ref) → Future<RecommendedStep?>
reviewSummariesForDomain(Ref 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 ref) → FlutterSecureStorage
selectedAiProvider(Ref 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 ref) → Future<List<DomainEntity>>
starterDomains(Ref ref) → Future<List<DomainEntity>>
The curated starter catalog (migration 072). Starters are public by construction, so this resolves for a brand-new learner who owns nothing.
starterEnrollmentIds(Ref ref) → Future<Set<String>>
Ids of the starters the learner has opted into. Drives the catalog's added/not-added state and the library's inclusion filter.
supabaseDatasource(Ref 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 ref) → SyncWorker?
Background drain worker that replays the OfflineOutbox into Supabase on every online tick from isOnlineProvider. null on web.
topicChunks(Ref ref, String topicId) → Future<List<ContentChunk>>
topicIdsWithContent(Ref ref, String domainId) → Future<Set<String>>
topicName(Ref ref, String topicId) → Future<String?>
Resolve a topic's title by ID (used as fallback when title isn't passed via route).
topicNotes(Ref ref, String topicId) → Future<List<UserNote>>
topicProgress(Ref ref, String topicId) → Future<UserTopicProgressModel?>
Single topic progress (used by lesson viewer to show read state).
topicTree(Ref ref, String domainId) → Future<List<Topic>>
totalCardCount(Ref ref) → Future<int>
useAiProxy(Ref ref) → Future<bool>
Whether the AI proxy is enabled (routes calls through Supabase Edge Function).
userAiSettingsDatasource(Ref 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 ref) → Future<List<UserNote>>
userPersona(Ref 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 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.