feat: Add professional ratings to cards, implement scroll-to-top on home tab re-tap, and improve agent type fetching in the hero section.

This commit is contained in:
pradeepkumar
2026-03-15 22:28:59 +05:30
parent 1fafbb1eb4
commit f6263b833c
6 changed files with 76 additions and 17 deletions

View File

@@ -55,14 +55,18 @@ class _HeroSectionState extends ConsumerState<HeroSection> {
context.push('/agents/search${queryString.isNotEmpty ? '?$queryString' : ''}');
}
void _showTypePicker() {
final topProState = ref.read(topProfessionalsProvider);
final agentTypes = topProState.agentTypes;
Future<void> _showTypePicker() async {
var agentTypes = ref.read(topProfessionalsProvider).agentTypes;
// If types haven't loaded yet, fetch them directly
if (agentTypes.isEmpty) {
// If types not loaded yet, just navigate to search
context.push('/agents/search');
return;
try {
final repo = ref.read(agentsRepositoryProvider);
agentTypes = await repo.getAgentTypes();
} catch (_) {
return;
}
if (!mounted || agentTypes.isEmpty) return;
}
showModalBottomSheet(