igot_http_service_helper 0.7.0
igot_http_service_helper: ^0.7.0 copied to clipboard
This package contains a set of high-level functions and classes that make it easy to consume HTTP resources. It's multi-platform (mobile, desktop, and browser) and supports multiple implementations wi [...]
0.7.0 #
- Enhanced POST request flexibility —
post()method now acceptsdynamic bodyfor support of various body types (Map, List, String, custom objects). - Updated cache key generation — now supports dynamic body types.
0.6.0 #
- Introduced
HttpAdapterabstract interface — pluggable HTTP client layer; swap out the default Dio implementation with any custom adapter viaHttpService.setAdapter(adapter). - Added
DioHttpAdapter— concrete Dio implementation ofHttpAdapter; all Dio-specific logic is now encapsulated here. - Introduced
HttpResponse<T>— new generic response model that replacesdio.Responseacross the public API. Access the decoded body viaresponse.data, status viaresponse.statusCode, and useresponse.isSuccessfor 2xx checks. - Introduced
HttpResponseTypeenum — package-agnostic replacement fordio.ResponseType; theresponseTypeparameter onget()andpost()now acceptsHttpResponseTypeinstead ofdio.ResponseType. - All
HttpServicemethods are now generic —get<T>(),post<T>(),put<T>(),patch<T>(),delete<T>()accept an explicit type parameter for strongly-typed responses. - Migrated
HiveServicefromBoxtoLazyBox— values are loaded on-demand, reducing memory footprint for large caches. - Cache compaction on cleanup —
deleteAllCacheData()andclearExpiredCache()(onHiveService) now callbox.compact()after deletion to reclaim disk space. - Updated barrel exports —
igot_http_service.dartnow exportsHttpResponse,HttpResponseType, andHttpAdapterso consumers no longer need direct Dio imports. RequestDeduplicationHelper.deduplicateRequestis now generic (deduplicateRequest<T>); removed unused utility methods (getPendingRequest,isPending,registerPendingRequest,removePendingRequest,clearAllPendingRequests,getPendingCount).- Breaking:
HttpService.getCacheStats()andHttpService.clearExpiredCache()removed from the publicHttpServiceAPI; useHiveService.getCacheStats()andHiveService.clearExpiredCache()directly. - Breaking:
responseTypeparameter type changed fromdio.ResponseTypetoHttpResponseType. - Breaking: All
HttpServicemethods now returnHttpResponse<T>instead ofdio.Response.
0.5.0 #
- Breaking change: Migrated the underlying HTTP client from
package:httptodio(^5.9.1).- All
HttpServicemethods now returndio.Response<dynamic>instead ofhttp.Response. - Response bodies are accessed via
response.data(auto-decoded by Dio) rather thanresponse.body. - File uploads now use
dio.FormData/dio.MultipartFileinternally.
- All
- Added
HttpService.configure()for one-time Dio timeout and connection-pool configuration (connectTimeout,receiveTimeout,sendTimeout,maxConnectionsPerHost). - Added
HttpService.upload()for multipart file uploads. - Added
HttpService.patch()for PATCH requests. - Added
HttpService.getCacheStats()/clearExpiredCache()/deleteAllCacheData()cache-management helpers. - Added request deduplication via
RequestDeduplicationHelperto collapse concurrent identical requests into a single network call. - Removed
package:httpdependency.
0.4.0 #
- Flutter version updated to 3.35.7
0.3.0 #
- Flutter version updated to 3.32.8
0.2.0 #
- Migrated from SQL-based local storage to Hive for significantly improved read/write performance.
- Updated caching logic to support Hive-backed storage.
- Refactored data access layers to align with Hive box architecture.
0.1.0 #
- Flutter version updated to 3.27.1
0.0.3 #
- Enhanced the functionality of retrieving data.
0.0.2 #
- Added force update feature.
0.0.1 #
- Initial release.
- The SDK facilitates users in making API calls, encompassing HTTP requests.
- It empowers users to cache API responses, with the capability to set a TTL (time-to-live) for the cached data.
- If the TTL duration hasn't elapsed, the SDK retrieves the data from the cache and returns it.
- In the event that the TTL has expired, the SDK initiates a fresh API request, stores the updated data with the new TTL, and then returns the response.
- If no TTL is provided by the user, the SDK automatically makes an API call and promptly returns the response.