ApiConnection class

One isolated API runtime used by a generated package.

Properties

auth → ApiAuth
final
cache → ApiCache
final
config → ApiBridgeConfig
final
cookies → ApiCookieManager
final
hashCode → int
The hash code for this object.
no setterinherited
key → String
final
rawDio → Dio
Escape hatch for legacy integrations. Generated packages should use execute so caching, retries, diagnostics, and invalidation remain active.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearActiveSessionCache() → Future<void>
clearAllCache() → Future<void>
clearSessionCache(String sessionId) → Future<void>
dispose() → Future<void>
execute<T>(ApiRequest<T> request) → Future<ApiResult<T>>
initializeUserSession({required String sessionId, String? bearerToken, Map<String, String>? authHeaders, Map<String, Object?> metadata = const <String, Object?>{}}) → Future<void>
Initializes the active user/cache session after generated login succeeds.
logout() → Future<void>
Clears all connection cache, credentials, and cookies.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

create({required String key, required ApiBridgeConfig config}) → Future<ApiConnection>