enrolledStarters function

  1. @riverpod
Future<List<DomainEntity>> enrolledStarters(
  1. Ref ref
)

Starter curricula the learner has actually added, as full entities.

Implementation

@riverpod
Future<List<DomainEntity>> enrolledStarters(Ref ref) async {
  final ids = await ref.watch(starterEnrollmentIdsProvider.future);
  if (ids.isEmpty) return const [];
  final ds = ref.watch(supabaseDatasourceProvider);
  final models = await ds.getDomainsByIds(ids);
  return models.map((m) => m.toEntity()).toList();
}