feat: Implement initial filtering for agent search from the home screen, enable footer navigation, and add provider stability checks.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user