domainProgress function

  1. @riverpod
Future<Map<String, String>> domainProgress(
  1. Ref<Object?> ref,
  2. String domainId
)

Map of topicId -> mastery level string for all topics in a domain.

Implementation

@riverpod
Future<Map<String, String>> domainProgress(Ref ref, String domainId) async {
  final ds = ref.watch(supabaseDatasourceProvider);
  final progressList = await ds.getAllProgressForDomain(domainId);
  return {for (final p in progressList) p.topicId: p.mastery};
}