api_request_handler 0.1.0 copy "api_request_handler: ^0.1.0" to clipboard
api_request_handler: ^0.1.0 copied to clipboard

A package for handling API requests with Dio with cache functionality and auto cancel duplicate requests.

0.1.0 #

  • Fix: Hive cache is now stored in the platform cache directory instead of the app Documents directory, so .hive/.lock files no longer show up in the iOS Files app. Leftover files from the old location are cleaned up automatically on first launch after upgrading.
  • Fix: cache key generation now sorts params and includes HTTP method + client name, so equivalent params in a different order hit the cache correctly, and the same endpoint on different clients/methods no longer collides.
  • Fix: duplicate in-flight requests (same endpoint/method/params/client) now actually get cancelled when a newer identical request starts, instead of only tracking a cancel token that was never used.
  • Fix: ApiParser.parseResponse is now applied to responses and no longer throws on a list of non-map items.
  • Add: enableLogging, connectTimeout/receiveTimeout/sendTimeout, defaultCacheDuration, and maxCacheEntries options on initialize/initializeMultipleClients.
  • Add: optional retry with backoff for transient network errors via configureRetries() or per-call retries/retryDelay.
  • Add: onSendProgress/onReceiveProgress passthrough on request().
  • Add: requestTyped<T>() for typed responses via fromJson.
  • Add: requestPaginated<T>() + PaginatedResponse<T> for list endpoints, with clearCacheForEndpoint() to invalidate all cached pages of a resource at once.
  • Add: clearAllCache().
  • Add: AuthInterceptor base class for the token-attach + refresh-on-401 pattern.
  • Add: isConnectedChecker hook to fail fast when offline instead of waiting on a socket timeout.
  • Test: added unit test coverage for ApiParser and CacheService.

0.0.1 #

  • initial release.
5
likes
150
points
103
downloads

Documentation

API reference

Publisher

verified publisherinnovationnxt.com

Weekly Downloads

A package for handling API requests with Dio with cache functionality and auto cancel duplicate requests.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

dio, flutter, hive, hive_flutter, path_provider

More

Packages that depend on api_request_handler