extended_http 1.0.0 copy "extended_http: ^1.0.0" to clipboard
extended_http: ^1.0.0 copied to clipboard

outdated

It extends HTTP package then combine with Hive to provide cache. It also supports authorization via custom headers.

Changelog #

1.0.0 Mar 15, 2023 #

  • New CachePolicy with 3 options:

    • NetworkFirst Fetch data from network, if failed, fetch from cache.
    • CacheFirst Fetch data from cache, if not existed, fetch from network.
    • NoCache Only fetch data from network. Never store data in cache.
  • Support multiple instances for multiple API domains, example:

    • ExtendedHttp() => get/set for default instance
    • ExtendedHttp("domain1") => get/set for instance of domain1
    • ExtendedHttp("domain2") => get/set for instance of domain2
  • Add debugId to easy filter out relevant logs when debugging, example

    ExtendedHttp().createURI(
      '/api',
      debugId: '123',
    )
    
  • Add authData for easy saving user credential, it can be used to store token or current user data.

    • Setter: setAuthData(Map<String, dynamic> data)
    • Getter: authData
    • Method of onUnauthorized now also have authData as parameter.
  • Add getter headers to get current headers and setter setHeaders

0.3.5 Feb 15, 2023 #

  • Fix log error when response body is null

0.3.4 Oct 25, 2022 #

Improve logging with color and added new log options

  • logURL
  • logRequestHeaders
  • logRespondHeaders
  • logRespondBody

0.2.4 Oct 25, 2022 #

Expose onError method so you can define your own logic there

0.1.4 Oct 21, 2022 #

Expose shouldRetry method so you can define your own logic there

0.0.4 Oct 21, 2022 #

Improve config headers to add new values instead of replace all.

From now, when calling config(headers: {new-headers})

  • matched headers will be overwritten
  • while others headers will be kept

0.0.3 Oct 5, 2022 #

Remove import dart:io

0.0.2 Oct 5, 2022 #

Update package description

0.0.1 Oct 5, 2022 #

Splitted from remote_data_provider

Support API response caching and custom authorization headers

4
likes
0
points
170
downloads

Publisher

verified publisherbesoft.vn

Weekly Downloads

It extends HTTP package then combine with Hive to provide cache. It also supports authorization via custom headers.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, hive, hive_flutter, http

More

Packages that depend on extended_http