From bb5e9ecf200f0c83c0a5caa50852b1392fc75232 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sat, 25 Nov 2023 10:06:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/native_dio_adapter/CHANGELOG.md | 4 +++- plugins/native_dio_adapter/README.md | 4 +--- plugins/native_dio_adapter/lib/src/native_adapter.dart | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/native_dio_adapter/CHANGELOG.md b/plugins/native_dio_adapter/CHANGELOG.md index c68a5d717..7e9bdaf7e 100644 --- a/plugins/native_dio_adapter/CHANGELOG.md +++ b/plugins/native_dio_adapter/CHANGELOG.md @@ -2,7 +2,9 @@ ## Unreleased -*None.* +- Adds `createCronetEngine` and `createCupertinoConfiguration` + to deprecate `cronetEngine` and `cupertinoConfiguration` + for the `NativeAdapter`, to avoid platform exceptions. ## 1.1.1 diff --git a/plugins/native_dio_adapter/README.md b/plugins/native_dio_adapter/README.md index d79ba0cbe..aab6c498b 100644 --- a/plugins/native_dio_adapter/README.md +++ b/plugins/native_dio_adapter/README.md @@ -39,9 +39,7 @@ Add the `native_dio_adapter` package to your ```dart final dioClient = Dio(); -if (Platform.isIOS || Platform.isMacOS || Platform.isAndroid) { - dioClient.httpClientAdapter = NativeAdapter(); -} +dioClient.httpClientAdapter = NativeAdapter(); ``` ## 📣 About the author diff --git a/plugins/native_dio_adapter/lib/src/native_adapter.dart b/plugins/native_dio_adapter/lib/src/native_adapter.dart index 2175b1bae..9bf31ac27 100644 --- a/plugins/native_dio_adapter/lib/src/native_adapter.dart +++ b/plugins/native_dio_adapter/lib/src/native_adapter.dart @@ -21,12 +21,14 @@ class NativeAdapter implements HttpClientAdapter { URLSessionConfiguration Function()? createCupertinoConfiguration, @Deprecated( 'Use createCronetEngine instead. ' - 'This will cause platform exception on iOS/macOS platforms', + 'This will cause platform exception on iOS/macOS platforms. ' + 'This will be removed in v2.0.0', ) CronetEngine? androidCronetEngine, @Deprecated( 'Use createCupertinoConfiguration instead. ' - 'This will cause platform exception on the Android platform', + 'This will cause platform exception on the Android platform. ' + 'This will be removed in v2.0.0', ) URLSessionConfiguration? cupertinoConfiguration, }) {