getLevelsForDomain method
- String domainId
Fetch all levels for a domain, ordered by level_number.
Implementation
Future<List<CurriculumLevelModel>> getLevelsForDomain(String domainId) async {
final response = await _client
.from('curriculum_levels')
.select()
.eq('domain_id', domainId)
.order('level_number', ascending: true);
return (response as List<dynamic>)
.map(
(row) => CurriculumLevelModel.fromJson(row as Map<String, dynamic>),
)
.toList();
}