getChunksForTopic method

Future<List<ContentChunkModel>> getChunksForTopic(
  1. String topicId
)

Implementation

Future<List<ContentChunkModel>> getChunksForTopic(String topicId) async {
  final response = await _client
      .from('content_chunks')
      .select()
      .eq('topic_id', topicId)
      .order('chunk_index', ascending: true);
  return (response as List<dynamic>)
      .map((row) => ContentChunkModel.fromJson(row as Map<String, dynamic>))
      .toList();
}