ApiClient class

HTTP client for making API requests to Prodobit backend

Constructors

ApiClient(ProdobitConfig config)

Properties

config ProdobitConfig
final
dio → Dio
Get the configured Dio instance
no setter
hashCode int
The hash code for this object.
no setterinherited
onAuthenticationFailed ↔ void Function()?
Callback for handling authentication failures (401 errors after refresh failed)
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAuthInterceptor(Interceptor authInterceptor) → void
Add auth interceptor for automatic token refresh This should be called after AuthService is initialized to avoid circular dependency
addCacheInterceptor(Interceptor cacheInterceptor) → void
Add cache interceptor for offline support This should be called after cache is initialized
delete<T>(String path, {dynamic data, Map<String, dynamic>? queryParameters, Options? options}) Future<T>
Perform a DELETE request
get<T>(String path, {Map<String, dynamic>? queryParameters, Options? options}) Future<T>
Perform a GET request
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post<T>(String path, {dynamic data, Map<String, dynamic>? queryParameters, Options? options}) Future<T>
Perform a POST request
put<T>(String path, {dynamic data, Map<String, dynamic>? queryParameters, Options? options}) Future<T>
Perform a PUT request
removeAuthToken() → void
Remove authorization token
removeOrganization() → void
Remove organization context
setAuthToken(String token) → void
Set authorization token
setOrganization(String organizationId) → void
Set organization context
toString() String
A string representation of this object.
inherited
uploadFile<T>(String path, String filePath, {String fieldName = 'file', Map<String, dynamic>? additionalData, ProgressCallback? onProgress}) Future<T>
Upload file with progress tracking

Operators

operator ==(Object other) bool
The equality operator.
inherited