updateAgent method
Implementation
Future<void> updateAgent(Agent agent) async {
await _agentService.updateAgent(agent);
int index = _agents.indexWhere((a) => a.id == agent.id);
if (index != -1) {
_agents[index] = agent;
notifyListeners();
}
}