packages/api_kit/api_kit
library
Classes
-
ApiCache
-
In-memory implementation of CacheStore with TTL-based expiry and
optional ETag storage for revalidation.
-
ApiInterceptor
-
Interceptor for logging and token handling.
-
ApiKit
-
A reusable API client for HTTP requests.
-
ApiLogger
-
Injectable, instance-based logger for the API kit.
-
CacheEntry
-
A cached entry holding a value, its expiry, and an optional ETag for
revalidation.
-
CacheStore
-
Abstraction over a cache storage backend.
-
ConnectivityChecker
-
Strategy for checking network connectivity before a request is made.
-
Cursor-based pagination strategy.
-
FlexibleInterceptor
-
A flexible interceptor that allows custom request/response handling
-
NoOpConnectivityChecker
-
Default connectivity checker that always reports a connection.
-
Offset-based pagination strategy driven by a PaginationConfig.
-
PaginatedResponse<T>
-
A parsed paginated response.
-
Configuration for offset-based pagination with configurable field keys.
-
Strategy that parses a paginated API response into a PaginatedResponse.
-
RequestDeduplicator
-
De-duplicates concurrent identical in-flight requests.
-
TokenRefreshInterceptor
-
Interceptor that performs automatic token refresh-and-retry on 401.
Enums
-
LogLevel
-
Log levels for the API logger.
Constants
-
Key used in
RequestOptions.extra to mark a request as already refreshed,
preventing infinite refresh-and-retry loops.
Functions
-
mapDioError(dynamic error)
→ Exception
-
Maps a
DioException to a typed ApiBaseException, preserving the server
response body so callers can reach field-level validation details.
-
parseResponse<T>(Response response, T parser(Map<String, dynamic> json))
→ T
-
Parses a successful Dio
response using a custom JSON parser.
Typedefs
-
TokenRefresher
= Future<String?> Function(DioException error, RequestOptions options)
-
Strategy that refreshes an expired auth token after a 401 response.