updateAgent method

Future<void> updateAgent(
  1. Agent agent
)

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();
  }
}