bond_network 0.1.1
bond_network: ^0.1.1 copied to clipboard
Network is a Bond package provides a convenient way to handle API response.
Changelog #
0.1.1 #
- Docs:
BondFireis no longer described as a singleton with a private constructor. Its doc comment now shows a request and explains that each instance uses theDioregistered in the service locator.
0.1.0 #
Breaking #
- Requires Dart 3.13 and Flutter 3.47 or newer.
- Depends on
bond_core: ^0.1.0andbond_cache: ^0.1.0. equatablerange is now>=2.0.7 <4.0.0. With equatable 3,==on models no longer comparesruntimeType, so two differentEquatablesubclasses with equalpropsare equal.package_info_plusrange is now>=8.2.1 <11.0.0(package_info_plus 10 needs iOS 13+).fakeris no longer a dependency.ServerExceptionFactory.createfills a missingcode/messagewith a random alphanumeric string fromdart:math.json_serializablemoved todev_dependencies. Apps that runbuild_runnermust depend on it themselves.ApiClient.postUritakes aUriandApiClient.deletetakes aStringpath (both were untyped; Dio already required these types at runtime).BondFire()returns a new instance on every call (since 0.0.11+11). Register it in get_it as a lazy singleton if you need one shared client.
Fixed #
Meta.fromwas annotated@JsonKey(name: 'last_page'), so regenerating the model made it readlast_page. The annotation is removed andmeta.g.dartregenerated;fromreads thefromkey.ServerError.fromJsonthrewtype 'Null' is not a subtype of type 'String'for error bodies withoutmessage/code(e.g. an AWS Lambda function URL's 403{"Message": null}), so theerrorFactorycrash replaced the real error. Missing values now default to'Unexpected server error'/'unknown'.
Changed #
dioconstraint^5.8.0.- Library names removed (
library;), lint fixes forflutter_lints6, code formatted with the Dart 3.13 formatter. - CHANGELOG 0.0.11+4: the new policy is
CachePolicy.cacheOnly(it was listed ascacheFirst).
0.0.11+11 #
- Remove the bond fire singleton factory.
0.0.11+9 #
Fixed #
- Fixed cache writes not completing before
execute()returns in tests.- Added microtask flush after cache writes to ensure
FlutterSecureStoragemock operations complete synchronously. - This resolves flaky tests where assertions ran before cache was updated.
- Added microtask flush after cache writes to ensure
0.0.11+4 #
Added #
- Added
this.totalproperty to theMetamodel. - Updated
bond_cachedependency to^0.0.4+3. - Refactored custom cache key handling in BaseBondApiRequest to support caching with explicit data types.
- Support factory on
cacheCustomKeymethod. - Fix
cachemethod to returnTinstead ofdynamic. - Fix
_factorymethod should take response after_dataTransformerdone. - Improve cache handling in
GetBondApiRequest. - Add new CachePolicy
cacheOnlyto read from cache first, if not found then read from network and save to cache.
0.0.10 #
Added #
- Added
patchmethod toBondFireto support PATCH HTTP requests. - Included DartDocs for the
patchmethod.
0.0.9 #
Added #
map()/transform()method inBondFireto mutate or transform raw API response before decoding.- Useful for cases where the API returns a list instead of a map, e.g.:
_api .get<HomeCms>(url) .map((data) => { "date": data }) .execute();
- Useful for cases where the API returns a list instead of a map, e.g.:
0.0.8 #
Added #
- Introduced
_cacheStoreproperty toGetBondApiRequest<T>for selecting a custom cache store. - Added full Dart documentation for all public methods and properties in
GetBondApiRequest. - Add Readme to the package.
- Add example to the package.
0.0.7 #
Added #
- Cancel Token Support: Added support for cancel tokens in API requests to allow for request cancellation.
0.0.6 #
Changed #
- Dependencies Updated:
- dio: upgraded from
^5.2.1+1to^5.8.0+1. - equatable: upgraded from
^2.0.5to^2.0.7. - json_annotation: upgraded from
^4.8.1to^4.9.0. - json_serializable: upgraded from
^6.7.1to^6.9.3. - package_info_plus: upgraded from
^4.1.0to^8.2.1. - meta: upgraded from
^1.8.0to^1.15.0. - faker: upgraded from
^2.0.0to^2.2.0.
- dio: upgraded from
- Bond Dependencies Updated:
- bond_core: upgraded from
^0.0.1to^0.0.3. - bond_cache: upgraded from
^0.0.1to^0.0.4+1.
- bond_core: upgraded from
0.0.5 #
- support form data multipart request.
0.0.4 #
- add currentPage property to Meta class.
0.0.3+1 #
- Update
bond_coredependency.
0.0.3 #
- Introduced
XListResponseextension forListResponseobjects.- New
mergemethod to combine twoListResponseinstances into a single instance.- Merges the
dataarrays. - Takes
metaandlinksfrom the secondListResponse.
- Merges the
- Use Cases:
- Combine paginated responses.
- Aggregate data from different sources.
- Update existing
ListResponsewith new data while preservingmetaandlinks.
- New
0.0.2+1 #
- Export
DoubleConvertertoBondNetwork'sconverterslist.
0.0.2 #
- Introduced
DoubleConverterclass to handle flexible JSON field types.- Converts incoming JSON values to
double. - Supports
String,int, anddoubleas input types. - Provides a default value fallback in case of conversion failure.
- Enhanced logging within
DoubleConverterfor better debugging.
- Converts incoming JSON values to
0.0.1+5 #
- fix caching when select cacheThenNetwork policy
0.0.1+4 #
- update bond_cache dependency.
- update bond_core dependency.
0.0.1+3 #
- fix read api return status code 403.
0.0.1+2 #
- handle the case where error.response!.data is string
0.0.1+1 #
- update bond_network package.
0.0.1 #
- initial release.