- fix: bug when initializing PlayxNetworkClient.
-
Mapping Enhancements:
- Enhanced mapping of Dio responses with support for processing in an isolate using the
work_manager
package or thecompute
method. - Added parameters for mapping options in
PlayxNetworkClientSettings
:useIsolateForMappingJson
: Determines whether to use an isolate for mapping JSON responses.useWorkManagerForMappingJsonInIsolate
: Specifies whether to usework_manager
or thecompute
function for JSON mapping in an isolate.
- Added the ability to override
PlayxNetworkClientSettings
for individual requests, similar to overridinglogSettings
orexceptionMessages
.
- Enhanced mapping of Dio responses with support for processing in an isolate using the
-
NetworkResult Enhancements:
- Added the following convenience getters to the
NetworkResult
class:isSuccess
: Checks if the network call is successful.isError
: Checks if the network call has failed.networkData
: Returns the data if the call is successful, otherwise returnsnull
.networkError
: Returns the error if the call has failed.
- Added the following convenience getters to the
-
Asynchronous Mapping:
- Introduced new mapping methods for
NetworkResult
:mapDataAsync
: Maps a network response (success or error) to a desired model asynchronously.mapDataAsyncInIsolate
: Maps a network response asynchronously in an isolate, with configurable options:mapper
: The function for transforming data.exceptionMessage
: A message to display in case of exceptions.useWorkManager
: Determines whether to usework_manager
orcompute
for JSON mapping.
mapAsyncInIsolate
: Separately maps success and error cases asynchronously in an isolate, with configurable options:success
: The function for mapping successful responses.error
: The function for mapping error responses.useWorkManager
: Determines whether to usework_manager
orcompute
.
- Introduced new mapping methods for
- fix: Bug causing error not being reported successfully.
- feat: Update
sentry_dio
package to v8.11.0.
- Add ability to download content using dio
download
method.
Note: This version contains breaking changes.
- Combined
PlayxNetworkClient
Settings:- Merged settings for
PlayxNetworkClient
into a newPlayxNetworkClientSettings
class. - Renamed
LoggerSettings
toPlayxNetworkLoggerSettings
.
- Merged settings for
- Custom Queries Support:
- Added the ability to include custom queries in network requests, enhancing flexibility for API interactions.
- Users can decide whether to use custom queries on a per-request basis by using the
attachCustomQuery
option.
-
Enhanced
PlayxNetworkLoggerSettings
:- Added options for attaching a logger in debug and release modes (
attachLoggerOnDebug
andattachLoggerOnRelease
).
- Added options for attaching a logger in debug and release modes (
-
Updated Dio Package:
- Upgraded Dio package to v5.7.0 for improved performance and features.
- Isolate-Based Data Processing:
- Integrated Dart's
Isolate
to handle data processing in network responses, offloading CPU-intensive tasks to separate threads, which improves app performance, particularly in scenarios involving large datasets.
- Integrated Dart's
- Sentry Dio Integration:
- Added the Sentry Dio package to automatically capture and report errors in network requests to Sentry. This integration provides better monitoring and error tracking for network-related issues.
- Updated
JsonMapper
Signature:- The
JsonMapper<T>
signature has been updated fromT Function(dynamic json)
toFutureOr<T> Function(dynamic json)
to support both synchronous and asynchronous JSON processing. This allows for more flexible and efficient handling of JSON data.
- The
- Fixed an issue where
getList
andpostList
methods did not return results when the API response was not a list. Now, proper error handling ensures that non-list responses are processed correctly, preventing potential runtime errors.
- Update packages.
Note: This version contains breaking changes.
- Update packages.
- Update
onUnauthorizedRequestReceived
callback to takeResponse
instead ofvoid
to be able to customize unauthorized error handling based on response. - Add
name
field for default error model.
- Update packages.
- Add unauthorizedRequestCodes to be able to handle different unauthorized request status codes returned from the api and fire onUnauthorizedRequestReceived callback.
- Add successRequestCodes to be able to handle different success request status codes returned from the api and fire onUnauthorizedRequestReceived callback.
- Enhance printing non api error messages.
- Update packages.
- Add
statusCode
toApiException
to be able to handle different error status codes returned from the api.
- Update packages.
- Bug fix, causing
onUnauthorizedRequestReceived
not called when receiving unauthorized request on certain cases.
- Add ability to not handle unauthorized requests on each request.
- [Breaking Change]! : Each Network Exception now takes errorMessage of type String instead of exceptionMessage
- Enhancements for default error model.
- Make
customHeaders
to be of type function that return a map to be updated correctly.
- fix some bugs causing error not being reported successfully.
- update from json to take dynamic json instead of map.
- initial release