feat: Implement agent network management and refactor app navigation with a new AppShell component.

This commit is contained in:
pradeepkumar
2026-03-08 16:05:08 +05:30
parent b4d22df8ba
commit 0362d7cfe0
25 changed files with 1545 additions and 1423 deletions

View File

@@ -195,6 +195,33 @@ class AgentsRepository {
}
}
/// Get received connection requests: GET /connection-requests/received?status=...
Future<List<Map<String, dynamic>>> getReceivedRequests(String status) async {
try {
final response = await _dio.get(
'${ApiConstants.connectionRequests}/received',
queryParameters: {'status': status},
);
final data = response.data['data'] as List<dynamic>? ?? [];
return data.cast<Map<String, dynamic>>();
} on DioException catch (_) {
return [];
}
}
/// Respond to connection request: PATCH /connection-requests/{id}/respond
Future<bool> respondToRequest(String requestId, String status) async {
try {
await _dio.patch(
'${ApiConstants.connectionRequests}/$requestId/respond',
data: {'status': status},
);
return true;
} on DioException catch (_) {
return false;
}
}
/// Get agent types: GET /agent-types
/// Response: { success, data: [...] }
Future<List<AgentType>> getAgentTypes() async {