diff --git a/lib/utils/platform_http_client_io.dart b/lib/utils/platform_http_client_io.dart index d4500086..851c63c7 100644 --- a/lib/utils/platform_http_client_io.dart +++ b/lib/utils/platform_http_client_io.dart @@ -4,6 +4,7 @@ import 'package:cronet_http/cronet_http.dart'; import 'package:cupertino_http/cupertino_http.dart'; import 'package:http/http.dart' as http; import 'package:http/io_client.dart'; +import 'package:win_http/win_http.dart'; /// Shared Cronet engine so all clients reuse the same connection pool. CronetEngine? _sharedEngine; @@ -21,5 +22,8 @@ http.Client createPlatformClient() { if (Platform.isIOS || Platform.isMacOS) { return CupertinoClient.defaultSessionConfiguration(); } + if (Platform.isWindows) { + return WinHttpClient.defaultConfiguration(); + } return IOClient(); } diff --git a/pubspec.lock b/pubspec.lock index c32e8c09..6bf60e51 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1475,6 +1475,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" + win_http: + dependency: "direct main" + description: + name: win_http + sha256: f5da1c955a39822f4287fd2ddaef9b878542d382d023a482b207647bf945023b + url: "https://pub.dev" + source: hosted + version: "0.1.0" window_manager: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 168a5f63..106c467f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -65,6 +65,7 @@ dependencies: ref: 9e150f7 cupertino_http: ^2.4.0 cronet_http: ^1.6.0 + win_http: ^0.1.0 dev_dependencies: flutter_test: