native_dio_client 0.0.3 copy "native_dio_client: ^0.0.3" to clipboard
native_dio_client: ^0.0.3 copied to clipboard

discontinuedreplaced by: native_dio_adapter

A client for Dio which makes use of cupertino_http and cronet_http to delegate HTTP requests to the native platform.

Native Dio Client #

pub package likes popularity pub points

Note: Experimental

The underlying technology is still considered experimental, therefore this is also considered experimental.

If you encounter bugs, consider fixing it by opening a PR or at least contribute a failing test case.

A client for Dio which makes use of cupertino_http and cronet_http to delegate HTTP requests to the native platform instead of the dart:io platforms.

Inspired by the Dart 2.18 release blog.

Motivation #

Using the native platform implementation, rather than the socket-based dart:io HttpClient implemententation, has several advantages:

  • It automatically supports platform features such VPNs and HTTP proxies.
  • It supports many more configuration options such as only allowing access through WiFi and blocking cookies.
  • It supports more HTTP features such as HTTP/3 and custom redirect handling.

Example #

final dioClient = Dio();
if (Platform.isIOS || Platform.isMacOS || Platform.isAndroid) {
  dioClient.httpClientAdapter = NativeAdapter();
}

📣 About the author #

  • Twitter Follow
  • GitHub followers
1
likes
130
pub points
38%
popularity

Publisher

verified publisheruekoetter.dev

A client for Dio which makes use of cupertino_http and cronet_http to delegate HTTP requests to the native platform.

Repository (GitHub)
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

github.com
www.buymeacoffee.com

License

Apache-2.0 (LICENSE)

Dependencies

cronet_http, cupertino_http, dio, http

More

Packages that depend on native_dio_client