feat: Implement initial filtering for agent search from the home screen, enable footer navigation, and add provider stability checks.

This commit is contained in:
pradeepkumar
2026-03-14 14:53:46 +05:30
parent 6928697c5c
commit ad94db5620
9 changed files with 699 additions and 155 deletions

View File

@@ -80,12 +80,14 @@ class SearchAgentsNotifier extends StateNotifier<SearchAgentsState> {
_repository.getAgentTypes(),
_repository.getFilterableFields(),
]);
if (!mounted) return;
state = state.copyWith(
agentTypes: results[0] as List<AgentType>,
filterFields: results[1] as List<FilterableField>,
);
await _fetchAgents(page: 1);
} catch (e) {
if (!mounted) return;
state = state.copyWith(isLoading: false, error: e.toString());
}
}
@@ -99,7 +101,7 @@ class SearchAgentsNotifier extends StateNotifier<SearchAgentsState> {
limit: 10,
filters: state.activeFilters.isNotEmpty ? state.activeFilters : null,
);
if (!mounted) return;
state = state.copyWith(
agents: append ? [...state.agents, ...response.data] : response.data,
currentPage: response.page,
@@ -108,6 +110,7 @@ class SearchAgentsNotifier extends StateNotifier<SearchAgentsState> {
isLoadingMore: false,
);
} catch (e) {
if (!mounted) return;
state = state.copyWith(
isLoading: false,
isLoadingMore: false,