diff --git a/dio/lib/src/adapter.dart b/dio/lib/src/adapter.dart index 96bf2149d..1f88a3fc1 100644 --- a/dio/lib/src/adapter.dart +++ b/dio/lib/src/adapter.dart @@ -4,6 +4,7 @@ import 'dart:typed_data'; import 'package:meta/meta.dart'; import 'adapters/io_adapter.dart' + if (dart.library.js_interop) 'adapters/browser_adapter.dart' if (dart.library.html) 'adapters/browser_adapter.dart' as adapter; import 'headers.dart'; import 'options.dart'; diff --git a/dio/lib/src/compute/compute.dart b/dio/lib/src/compute/compute.dart index a1c1aef4d..291b46466 100644 --- a/dio/lib/src/compute/compute.dart +++ b/dio/lib/src/compute/compute.dart @@ -25,7 +25,9 @@ import 'dart:async'; -import 'compute_io.dart' if (dart.library.html) 'compute_web.dart' as _c; +import 'compute_io.dart' + if (dart.library.js_interop) 'compute_web.dart' + if (dart.library.html) 'compute_web.dart' as _c; /// Signature for the callback passed to [compute]. /// diff --git a/dio/lib/src/dio.dart b/dio/lib/src/dio.dart index 0cbd18529..321398745 100644 --- a/dio/lib/src/dio.dart +++ b/dio/lib/src/dio.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'adapter.dart'; import 'cancel_token.dart'; import 'dio/dio_for_native.dart' + if (dart.library.js_interop) 'dio/dio_for_browser.dart' if (dart.library.html) 'dio/dio_for_browser.dart'; import 'dio_mixin.dart'; import 'headers.dart'; diff --git a/dio/lib/src/dio_mixin.dart b/dio/lib/src/dio_mixin.dart index 87c04e17c..dbc1bd96b 100644 --- a/dio/lib/src/dio_mixin.dart +++ b/dio/lib/src/dio_mixin.dart @@ -16,6 +16,7 @@ import 'headers.dart'; import 'interceptors/imply_content_type.dart'; import 'options.dart'; import 'progress_stream/io_progress_stream.dart' + if (dart.library.js_interop) 'progress_stream/browser_progress_stream.dart' if (dart.library.html) 'progress_stream/browser_progress_stream.dart'; import 'response.dart'; import 'response/response_stream_handler.dart'; diff --git a/dio/lib/src/multipart_file.dart b/dio/lib/src/multipart_file.dart index f40e050cf..8d451a4d3 100644 --- a/dio/lib/src/multipart_file.dart +++ b/dio/lib/src/multipart_file.dart @@ -4,6 +4,7 @@ import 'dart:typed_data' show Uint8List; import 'package:http_parser/http_parser.dart' show MediaType; import 'multipart_file/io_multipart_file.dart' + if (dart.library.js_interop) 'multipart_file/browser_multipart_file.dart' if (dart.library.html) 'multipart_file/browser_multipart_file.dart'; import 'utils.dart';