API HTTP Client
Component Detail
Infrastructure
high complexity
Shared Component
mobile
0
Dependencies
11
Dependents
2
Entities
0
Integrations
Description
Centralized HTTP client wrapping Dart's http or Dio with JWT bearer token injection, automatic token refresh on 401 responses, a 15-second timeout, and a typed ApiException hierarchy. Used by every feature that communicates with the REST API; Background Sync relies on it exclusively for dispatching outbox mutations.
api-http-client
Responsibilities
- Attach Authorization header with current access token to every outgoing request
- Intercept 401 responses and transparently refresh the access token before retrying
- Map HTTP error responses to typed ApiException subclasses for structured error handling
- Enforce request timeout and surface TimeoutException through the ApiException hierarchy
Interfaces
get(path: String, {Map<String, String>? headers}) -> Future<ApiResponse>
post(path: String, body: Map<String, dynamic>) -> Future<ApiResponse>
put(path: String, body: Map<String, dynamic>) -> Future<ApiResponse>
delete(path: String) -> Future<ApiResponse>
patch(path: String, body: Map<String, dynamic>) -> Future<ApiResponse>
Relationships
Dependents (11)
Components that depend on this component
service
Organization Membership Service
ui
Events List Screen
ui
Event Detail Screen
service
Note Attachment Upload Service
service
Team Statistics Service
service
Certificate Service
service
Workshop Service
service
Cards Content Service
service
Versioned Content Service
service
FAQ Content Service
service
Sync Queue Service
Related Data Entities (2)
Data entities managed by this component