getAgentById method

Future<Agent> getAgentById(
  1. String agentId
)

Implementation

Future<Agent> getAgentById(String agentId) async {
  try {
    final agent = await _agentService.getAgentById(agentId);
    print("agent in settings ${agent.name}");
    return agent;
  } catch (e) {
    print('Error fetching agent: $e');
    rethrow;
  }
}