net_kit 5.3.1
net_kit: ^5.3.1 copied to clipboard
Netkit is a library that provides a set of tools to work with network requests.
5.3.0 #
New Features #
- Added
useDataKeyparameter to all request methods (requestModel,requestModelMeta,requestList,requestListMeta,uploadMultipartData,uploadFormData) - The
useDataKeyparameter allows you to control whether to use the configureddataKeywrapper for individual requests - Default value is
trueto maintain backward compatibility - When set to
false, the response data will be used directly without dataKey extraction - This is useful when you have different API endpoints that return data in different formats
Improvements #
- Enhanced flexibility for handling APIs with different response structures
- Better control over data extraction on a per-request basis
5.2.5 #
- updated sponsors
5.2.1 #
- Fixed issue with
NetKitManagernot properly handling theloggerEnabledoption.
5.2.0 #
- Added
loggerEnabledoption toNetKitManagerto enable or disable logging.
5.1.2 #
- Added more tests to make sure Refresh Token works as intended.
5.1.1 #
- updated README regarding
VoidModelusage inUpload
5.1.0 #
- update type check for VoidModel in UploadManagerMixin
5.0.0 #
Breaking Changes #
- refresh token request is now sent via body. Reference: Refreshing an Access Token
- removal:
refreshTokenHeaderKeyis removed since refreshToken should not be in the header. Reference: Refreshing an Access Token
New Features #
- Added
removeAccessTokenBeforeRefresh: A new top-level option in NetKitManager to remove the access token from headers during a token refresh. - Added
accessTokenPrefix: Allows you to define a custom token prefix (e.g., Bearer, Token) when setting the access token. - Introduced
onBeforeRefreshRequestcallback: Lets you modify the refresh token request before it is sent — useful for injecting custom headers or modifying the request body. IntroducedNetKitRequestOptions: A new abstraction to simplify and standardize refresh token request configuration. - Introduced
onRefreshFailedcallback: This callback is triggered when the refresh token request fails. It provides a way to handle errors or perform specific actions when the refresh token process encounters issues. - Added
metadataDataKey: Enables support for parsing the actual data nested inside metadata wrappers from API responses. - Added
requestModelMetaandrequestListMetamethods:
Improvements #
Improved error handling in ApiException
- Added
debugMessageanderrorfields to provide more detailed diagnostics. - Better support for SocketException and network-related errors via
ApiException.fromJson
4.0.0 #
Breaking change: removed authenticate methodBreaking change: refresh tokens are now parsed from only body, since it is a common practice to return the new access token and, if needed, the new refresh token via body for more security. If you want to handle the refresh token manually, you can use add custom interceptor to handle the refresh token. **Reference **: Issuing an Access Token: Successful ResponseBreaking change: updatedaccessTokenKeyasaccessTokenHeaderKeyBreaking change: updatedrefreshTokenKeyasrefreshTokenHeaderKey- added
accessTokenBodyKeytoNetKitManagerto parse the access token from the body - added
refreshTokenBodyKeytoNetKitManagerto parse the refresh token from the body
3.6.0 #
- deprecated
authenticatemethod - updated the code for the latest lint rules
3.5.1 #
- improved error handling in uploadMultipartData and uploadMultipartDataList methods
3.5.0 #
- fixed: uploadMultipartData and uploadMultipartDataList methods do not cover all error handling
3.4.3 #
- configured import of http-adapter to support wasm
3.4.2 #
- added @override to _logger in NetKitManager
3.4.1 #
- added logger.error in _sendRequest method
3.4.0 #
Note: This release has breaking changes.
logLevelis removed, since INetKitLogger instance injected to the NetKitManager. This is done to provide more flexibility to the developers to use their own logger.loggerEnabledis renamed tologInterceptorEnabledinNetKitManagerto provide more clarity.- added
loggerparameter to theNetKitManagerto provide more flexibility to the developers to use their own logger.
3.3.4 #
- authentication issue fixed
3.3.2 #
- exported
VoidModelclass
3.3.1 #
- fixed
authenticationissue while parsing the response
3.3.0 #
- added
containsAccessTokento requests
3.2.0 #
- fixed bug in _retryRequest with FormData
3.1.0 #
- added
VoidModelclass for void responses - added
uploadMultipartDatamethod to upload files - internal refactoring
3.0.9-dev #
- internal refactoring
3.0.8-dev #
- added
VoidModelclass
3.0.2-dev #
- added
uploadMultipartDatamethod
3.0.1 #
- updated README.md
3.0.0 #
Note: This release has breaking change.
Breaking change: Renamed methodsaddBearerTokentosetAccessTokenaddRefreshTokentosetRefreshTokenremoveBearerTokentoremoveAccessToken
Feature: AddedrefreshTokenfeature. Refresh token is automatically refreshed when the access token is expired. Just addrefreshTokenPathto theNetKitManagerand it will automatically refresh the token. Note: the refresh token API in backend should return the new access token and, if needed, the new refresh token via headers for more security. If you want to handle the refresh token manually, you can use add custom interceptor to handle the refresh token.
2.4.5-dev #
- updated error handling
2.4.4-dev #
- added loggers in error handling interceptor
- fixed issue in error handling interceptor
2.4.0 #
- added
authenticatemethod and provided the example in README.md - added
addRefreshTokenandremoveRefreshTokenmethods toNetKitManager - updated documentation on how to use
authenticatemethod
2.3.3-dev #
- updated documentation on how to use
authenticatemethod
2.3.2-dev #
- exported
AuthTokenModelclass
2.3.1-dev #
- added
authenticatemethod and provided the example in README.md - added
addRefreshTokenandremoveRefreshTokenmethods toNetKitManager
2.3.0 #
- fixed error
Cannot read properties of undefined (reading 'new')in web with workaround - added integration test for -release tags
2.2.0-dev #
- fixed error
Cannot read properties of undefined (reading 'new')in web with workaround - added flutter-project to test web
2.1.2 #
- updated NetKitLogger to use only required imports from logger
2.1.0 #
Note: This release has breaking change.
- downgraded SDK version to support more versions
- Breaking change: body's type parameter in
requestModelandrequestListmethods is changed toMap<String, dynamic>
2.0.1 #
- updated README.md
2.0.0 #
Note: This release has breaking changes.
- Removed the generic type parameter
<T>fromINetKitModel. When you extendINetKitModel, you don't need to provide the generic type parameter anymore. - updated documentations
2.0.0-dev.2 #
- updated documentations
2.0.0-dev.1 #
Note: This release has breaking changes.
- Removed the generic type parameter
<T>fromINetKitModel. When you extendINetKitModel, you don't need to provide the generic type parameter anymore.
1.8.3 #
- Exported
NetKitErrorParamsclass
1.8.2 #
- exported
LogLevelenum
1.8.1 #
- fixed data is not parsed to json.
1.8.0 #
- added JsonUnsupportedObjectError to handle unsupported objects in json
- added String for error message:
JsonUnsupportedObjectError
1.7.0 #
- updated error handling to provide more information
1.6.2 #
- added more integration test cases
- added missing documentations
1.6.1 #
- added integration test from typicode
1.6.0 #
- log messages improved
1.6.0-dev.1 #
- updated HttpClientAdapter to support web
- added log messages
1.5.3 #
- added example
- updated error handling
1.5.2 #
- updated README.md
- declared platform supports
1.5.1 #
- updated README.md
- declared
websupport
1.5.0 #
- Stable: Added
internetStatusStreamto listen to the internet status
1.5.0-dev.2 #
- fixed no internet connection handler
1.5.0-dev.1 #
- Added
internetStatusStreamto listen to the internet status
1.4.1 #
Note: This release has breaking changes.
NetKitErrorParamsintroduced to handle error messages and status codes. It is required to provide internationalized error messages.errorMessageKeyin the NetKitManager key is moved toNetKitErrorParamsclass asmessageKeyerrorStatusCodeKeyin the NetKitManager key is moved toNetKitErrorParamsclass asstatusCodeKey
1.3.1 #
- added tasks to be done in the future
1.3.0 #
- Equality operator removed from
ApiExceptionclass - Updated README.md with correct examples
- Empty
jsonerror handling improved
1.2.2 #
- Equality operator added to
ApiExceptionclass
1.2.1 #
- error handler updated
1.2.0 #
- error handler updated
1.1.1 #
- exported dio classes
1.1.0 #
- updated README.md
- exported ApiException
- updated documentation
1.0.0 #
Note: This release has breaking changes.
- Return type of
requestModelchanged toFuture<T> - Return type of
requestListchanged toFuture<List<T>> - Return type of
requestVoidchanged toFuture<void> ApiExceptionis introduced as an exception that is thrown when an error occurs during the request
0.2.2 #
- integration tests added
- unit tests updated
- error handler improved
0.2.1 #
- updated README.md
0.2.0 #
- added documentations for public methods
- equatable dependency removed
0.1.3 #
- updated README.md: added image
- web dependency added
0.1.2 #
- fixed homepage and issue_tracker
0.1.1 #
- Updated README.md
0.1.0 #
- Initial release.