topicName function

  1. @riverpod
Future<String?> topicName(
  1. Ref<Object?> ref,
  2. String topicId
)

Resolve a topic's title by ID (used as fallback when title isn't passed via route).

Implementation

@riverpod
Future<String?> topicName(Ref ref, String topicId) async {
  final ds = ref.watch(supabaseDatasourceProvider);
  final topic = await ds.getTopicById(topicId);
  return topic?.title;
}