getTopicsForLevel method
- String levelId
Fetch topics assigned to a specific curriculum level.
Implementation
Future<List<TopicModel>> getTopicsForLevel(String levelId) async {
final response = await _client
.from('topics')
.select()
.eq('curriculum_level_id', levelId)
.order('sort_order', ascending: true);
return (response as List<dynamic>)
.map((row) => TopicModel.fromJson(row as Map<String, dynamic>))
.toList();
}