Repository: cfug/dio
Branch: main
Commit: 85aa6f121620
Files: 423
Total size: 1.0 MB
Directory structure:
gitextract_7_0du2a0/
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug.yml
│ │ ├── config.yaml
│ │ ├── feature.yml
│ │ └── infra.yml
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── dependabot.yaml
│ └── workflows/
│ ├── check_issues_access.yml
│ ├── coverage_base.yml
│ ├── coverage_comment.yml
│ ├── publish.yml
│ └── tests.yml
├── .gitignore
├── .idea/
│ └── modules.xml
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── COMPATIBILITY_POLICY.md
├── CONTRIBUTING-ZH.md
├── CONTRIBUTING.md
├── LICENSE
├── README-ZH.md
├── README.md
├── SECURITY.md
├── analysis_options.yaml
├── dio/
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README-ZH.md
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── dart_test.yaml
│ ├── dartdoc_options.yaml
│ ├── dio.iml
│ ├── doc/
│ │ ├── migration_guide.md
│ │ └── plugins.md
│ ├── example/
│ │ └── dio.dart
│ ├── lib/
│ │ ├── browser.dart
│ │ ├── dio.dart
│ │ ├── fix_data/
│ │ │ └── fix.yaml
│ │ ├── io.dart
│ │ └── src/
│ │ ├── adapter.dart
│ │ ├── adapters/
│ │ │ ├── browser_adapter.dart
│ │ │ └── io_adapter.dart
│ │ ├── cancel_token.dart
│ │ ├── compute/
│ │ │ ├── compute.dart
│ │ │ ├── compute_io.dart
│ │ │ └── compute_web.dart
│ │ ├── dio/
│ │ │ ├── dio_for_browser.dart
│ │ │ └── dio_for_native.dart
│ │ ├── dio.dart
│ │ ├── dio_exception.dart
│ │ ├── dio_mixin.dart
│ │ ├── form_data.dart
│ │ ├── headers.dart
│ │ ├── interceptor.dart
│ │ ├── interceptors/
│ │ │ ├── imply_content_type.dart
│ │ │ └── log.dart
│ │ ├── multipart_file/
│ │ │ ├── browser_multipart_file.dart
│ │ │ └── io_multipart_file.dart
│ │ ├── multipart_file.dart
│ │ ├── options.dart
│ │ ├── parameter.dart
│ │ ├── progress_stream/
│ │ │ ├── browser_progress_stream.dart
│ │ │ └── io_progress_stream.dart
│ │ ├── redirect_record.dart
│ │ ├── response/
│ │ │ └── response_stream_handler.dart
│ │ ├── response.dart
│ │ ├── transformer.dart
│ │ ├── transformers/
│ │ │ ├── background_transformer.dart
│ │ │ ├── fused_transformer.dart
│ │ │ ├── sync_transformer.dart
│ │ │ └── util/
│ │ │ ├── consolidate_bytes.dart
│ │ │ └── transform_empty_to_null.dart
│ │ └── utils.dart
│ ├── pubspec.yaml
│ └── test/
│ ├── adapters_test.dart
│ ├── cancel_token_test.dart
│ ├── connect_timeout_integration_test.dart
│ ├── dio_mixin_test.dart
│ ├── encoding_test.dart
│ ├── exception_test.dart
│ ├── formdata_test.dart
│ ├── headers_test.dart
│ ├── interceptor_test.dart
│ ├── mimetype_test.dart
│ ├── mock/
│ │ ├── _formdata
│ │ ├── _testfile
│ │ ├── adapters.dart
│ │ ├── http_mock.dart
│ │ └── http_mock.mocks.dart
│ ├── multipart_file_test.dart
│ ├── options_test.dart
│ ├── options_timeout_integration_test.dart
│ ├── parameter_test.dart
│ ├── pinning_test.dart
│ ├── queued_interceptor_test.dart
│ ├── response/
│ │ └── response_stream_test.dart
│ ├── stacktrace_test.dart
│ ├── test_suite_test.dart
│ ├── timeout_test.dart
│ ├── transformer_test.dart
│ └── utils.dart
├── dio_test/
│ ├── LICENSE
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── dio_test.iml
│ ├── lib/
│ │ ├── src/
│ │ │ ├── httpbun.dart
│ │ │ ├── matcher.dart
│ │ │ ├── test/
│ │ │ │ ├── basic_tests.dart
│ │ │ │ ├── cancellation_tests.dart
│ │ │ │ ├── cors_tests.dart
│ │ │ │ ├── download_tests.dart
│ │ │ │ ├── headers_tests.dart
│ │ │ │ ├── http_method_tests.dart
│ │ │ │ ├── parameter_tests.dart
│ │ │ │ ├── redirect_tests.dart
│ │ │ │ ├── status_code_tests.dart
│ │ │ │ ├── suite.dart
│ │ │ │ ├── timeout_tests.dart
│ │ │ │ ├── upload_tests.dart
│ │ │ │ └── url_encoded_tests.dart
│ │ │ └── utils.dart
│ │ ├── tests.dart
│ │ └── util.dart
│ └── pubspec.yaml
├── dio_workspace.iml
├── example_dart/
│ ├── .gitignore
│ ├── analysis_options.yaml
│ ├── dart_test.yaml
│ ├── dio_example.iml
│ ├── lib/
│ │ ├── adapter.dart
│ │ ├── cancel_request.dart
│ │ ├── certificate_pinning.dart
│ │ ├── cookie_mgr.dart
│ │ ├── custom_cache_interceptor.dart
│ │ ├── dio.dart
│ │ ├── download.dart
│ │ ├── download_with_trunks.dart
│ │ ├── extend_dio.dart
│ │ ├── formdata.dart
│ │ ├── generic.dart
│ │ ├── http2_adapter.dart
│ │ ├── options.dart
│ │ ├── post_stream_and_bytes.dart
│ │ ├── proxy.dart
│ │ ├── queue_interceptors.dart
│ │ ├── queued_interceptor_crsftoken.dart
│ │ ├── request_interceptors.dart
│ │ ├── response_interceptor.dart
│ │ ├── test.dart
│ │ ├── transformer.dart
│ │ └── upload.txt
│ └── pubspec.yaml
├── example_flutter_app/
│ ├── .gitignore
│ ├── .metadata
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── android/
│ │ ├── .gitignore
│ │ ├── app/
│ │ │ ├── build.gradle.kts
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin/
│ │ │ │ └── cn/
│ │ │ │ └── flutter/
│ │ │ │ └── dio_flutter_example/
│ │ │ │ └── MainActivity.kt
│ │ │ └── res/
│ │ │ ├── drawable/
│ │ │ │ └── launch_background.xml
│ │ │ ├── drawable-v21/
│ │ │ │ └── launch_background.xml
│ │ │ ├── values/
│ │ │ │ └── styles.xml
│ │ │ └── values-night/
│ │ │ └── styles.xml
│ │ ├── build.gradle.kts
│ │ ├── dio_flutter_example_android.iml
│ │ ├── gradle/
│ │ │ └── wrapper/
│ │ │ └── gradle-wrapper.properties
│ │ ├── gradle.properties
│ │ └── settings.gradle.kts
│ ├── dio_flutter_example.iml
│ ├── example_flutter_app.iml
│ ├── ios/
│ │ ├── .gitignore
│ │ ├── Flutter/
│ │ │ ├── AppFrameworkInfo.plist
│ │ │ ├── Debug.xcconfig
│ │ │ └── Release.xcconfig
│ │ ├── Runner/
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── LaunchImage.imageset/
│ │ │ │ ├── Contents.json
│ │ │ │ └── README.md
│ │ │ ├── Base.lproj/
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── Info.plist
│ │ │ └── Runner-Bridging-Header.h
│ │ ├── Runner.xcodeproj/
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace/
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata/
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ └── xcshareddata/
│ │ │ └── xcschemes/
│ │ │ └── Runner.xcscheme
│ │ ├── Runner.xcworkspace/
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata/
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ │ └── RunnerTests/
│ │ └── RunnerTests.swift
│ ├── lib/
│ │ ├── http.dart
│ │ ├── main.dart
│ │ └── routes/
│ │ └── request.dart
│ ├── linux/
│ │ ├── .gitignore
│ │ ├── CMakeLists.txt
│ │ ├── flutter/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── generated_plugin_registrant.cc
│ │ │ ├── generated_plugin_registrant.h
│ │ │ └── generated_plugins.cmake
│ │ └── runner/
│ │ ├── CMakeLists.txt
│ │ ├── main.cc
│ │ ├── my_application.cc
│ │ └── my_application.h
│ ├── macos/
│ │ ├── .gitignore
│ │ ├── Flutter/
│ │ │ ├── Flutter-Debug.xcconfig
│ │ │ ├── Flutter-Release.xcconfig
│ │ │ └── GeneratedPluginRegistrant.swift
│ │ ├── Runner/
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets/
│ │ │ │ └── AppIcon.appiconset/
│ │ │ │ └── Contents.json
│ │ │ ├── Base.lproj/
│ │ │ │ └── MainMenu.xib
│ │ │ ├── Configs/
│ │ │ │ ├── AppInfo.xcconfig
│ │ │ │ ├── Debug.xcconfig
│ │ │ │ ├── Release.xcconfig
│ │ │ │ └── Warnings.xcconfig
│ │ │ ├── DebugProfile.entitlements
│ │ │ ├── Info.plist
│ │ │ ├── MainFlutterWindow.swift
│ │ │ └── Release.entitlements
│ │ ├── Runner.xcodeproj/
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace/
│ │ │ │ └── xcshareddata/
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ └── xcshareddata/
│ │ │ └── xcschemes/
│ │ │ └── Runner.xcscheme
│ │ ├── Runner.xcworkspace/
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata/
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── RunnerTests/
│ │ └── RunnerTests.swift
│ ├── pubspec.yaml
│ ├── web/
│ │ ├── index.html
│ │ └── manifest.json
│ └── windows/
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter/
│ │ ├── CMakeLists.txt
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
│ └── runner/
│ ├── CMakeLists.txt
│ ├── Runner.rc
│ ├── flutter_window.cpp
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── resource.h
│ ├── runner.exe.manifest
│ ├── utils.cpp
│ ├── utils.h
│ ├── win32_window.cpp
│ └── win32_window.h
├── melos.yaml
├── plugins/
│ ├── compatibility_layer/
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── analysis_options.yaml
│ │ ├── dart_test.yaml
│ │ ├── dio_compatibility_layer.iml
│ │ ├── example/
│ │ │ └── conversion_layer_example.dart
│ │ ├── lib/
│ │ │ ├── dio_compatibility_layer.dart
│ │ │ └── src/
│ │ │ └── conversion_layer_adapter.dart
│ │ ├── pubspec.yaml
│ │ └── test/
│ │ ├── client_mock.dart
│ │ └── conversion_layer_adapter_test.dart
│ ├── cookie_manager/
│ │ ├── .gitignore
│ │ ├── .metadata
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── analysis_options.yaml
│ │ ├── dart_test.yaml
│ │ ├── dio_cookie_manager.iml
│ │ ├── example/
│ │ │ └── example.dart
│ │ ├── lib/
│ │ │ ├── dio_cookie_manager.dart
│ │ │ └── src/
│ │ │ ├── cookie_mgr.dart
│ │ │ └── exception.dart
│ │ ├── pubspec.yaml
│ │ └── test/
│ │ ├── basic_test.dart
│ │ ├── cookies_persistance_test.dart
│ │ └── cookies_test.dart
│ ├── http2_adapter/
│ │ ├── .gitignore
│ │ ├── .metadata
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── analysis_options.yaml
│ │ ├── dart_test.yaml
│ │ ├── dio_http2_adapter.iml
│ │ ├── doc/
│ │ │ └── migration_guide.md
│ │ ├── example/
│ │ │ └── example.dart
│ │ ├── lib/
│ │ │ ├── dio_http2_adapter.dart
│ │ │ └── src/
│ │ │ ├── client_setting.dart
│ │ │ ├── connection_manager.dart
│ │ │ ├── connection_manager_imp.dart
│ │ │ └── http2_adapter.dart
│ │ ├── pubspec.yaml
│ │ └── test/
│ │ ├── http2_test.dart
│ │ ├── pinning_test.dart
│ │ ├── redirect_test.dart
│ │ └── test_suite_test.dart
│ ├── native_dio_adapter/
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── analysis_options.yaml
│ │ ├── example/
│ │ │ ├── .gitignore
│ │ │ ├── analysis_options.yaml
│ │ │ ├── android/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── app/
│ │ │ │ │ ├── build.gradle
│ │ │ │ │ └── src/
│ │ │ │ │ ├── debug/
│ │ │ │ │ │ └── AndroidManifest.xml
│ │ │ │ │ ├── main/
│ │ │ │ │ │ ├── AndroidManifest.xml
│ │ │ │ │ │ ├── kotlin/
│ │ │ │ │ │ │ └── com/
│ │ │ │ │ │ │ └── example/
│ │ │ │ │ │ │ └── example/
│ │ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ │ │ └── res/
│ │ │ │ │ │ ├── drawable/
│ │ │ │ │ │ │ └── launch_background.xml
│ │ │ │ │ │ ├── drawable-v21/
│ │ │ │ │ │ │ └── launch_background.xml
│ │ │ │ │ │ ├── values/
│ │ │ │ │ │ │ └── styles.xml
│ │ │ │ │ │ └── values-night/
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ └── profile/
│ │ │ │ │ └── AndroidManifest.xml
│ │ │ │ ├── build.gradle
│ │ │ │ ├── gradle/
│ │ │ │ │ └── wrapper/
│ │ │ │ │ └── gradle-wrapper.properties
│ │ │ │ ├── gradle.properties
│ │ │ │ └── settings.gradle
│ │ │ ├── ios/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── Flutter/
│ │ │ │ │ ├── AppFrameworkInfo.plist
│ │ │ │ │ ├── Debug.xcconfig
│ │ │ │ │ └── Release.xcconfig
│ │ │ │ ├── Podfile
│ │ │ │ ├── Runner/
│ │ │ │ │ ├── AppDelegate.swift
│ │ │ │ │ ├── Assets.xcassets/
│ │ │ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ │ │ └── Contents.json
│ │ │ │ │ │ └── LaunchImage.imageset/
│ │ │ │ │ │ ├── Contents.json
│ │ │ │ │ │ └── README.md
│ │ │ │ │ ├── Base.lproj/
│ │ │ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ │ │ └── Main.storyboard
│ │ │ │ │ ├── Info.plist
│ │ │ │ │ └── Runner-Bridging-Header.h
│ │ │ │ ├── Runner.xcodeproj/
│ │ │ │ │ ├── project.pbxproj
│ │ │ │ │ ├── project.xcworkspace/
│ │ │ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ │ │ └── xcshareddata/
│ │ │ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ │ │ └── xcshareddata/
│ │ │ │ │ └── xcschemes/
│ │ │ │ │ └── Runner.xcscheme
│ │ │ │ └── Runner.xcworkspace/
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata/
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ ├── lib/
│ │ │ │ └── main.dart
│ │ │ ├── linux/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── flutter/
│ │ │ │ │ ├── CMakeLists.txt
│ │ │ │ │ ├── generated_plugin_registrant.cc
│ │ │ │ │ ├── generated_plugin_registrant.h
│ │ │ │ │ └── generated_plugins.cmake
│ │ │ │ ├── main.cc
│ │ │ │ ├── my_application.cc
│ │ │ │ └── my_application.h
│ │ │ ├── macos/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── Flutter/
│ │ │ │ │ ├── Flutter-Debug.xcconfig
│ │ │ │ │ ├── Flutter-Release.xcconfig
│ │ │ │ │ └── GeneratedPluginRegistrant.swift
│ │ │ │ ├── Podfile
│ │ │ │ ├── Runner/
│ │ │ │ │ ├── AppDelegate.swift
│ │ │ │ │ ├── Assets.xcassets/
│ │ │ │ │ │ └── AppIcon.appiconset/
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ ├── Base.lproj/
│ │ │ │ │ │ └── MainMenu.xib
│ │ │ │ │ ├── Configs/
│ │ │ │ │ │ ├── AppInfo.xcconfig
│ │ │ │ │ │ ├── Debug.xcconfig
│ │ │ │ │ │ ├── Release.xcconfig
│ │ │ │ │ │ └── Warnings.xcconfig
│ │ │ │ │ ├── DebugProfile.entitlements
│ │ │ │ │ ├── Info.plist
│ │ │ │ │ ├── MainFlutterWindow.swift
│ │ │ │ │ └── Release.entitlements
│ │ │ │ ├── Runner.xcodeproj/
│ │ │ │ │ ├── project.pbxproj
│ │ │ │ │ ├── project.xcworkspace/
│ │ │ │ │ │ └── xcshareddata/
│ │ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ │ │ └── xcshareddata/
│ │ │ │ │ └── xcschemes/
│ │ │ │ │ └── Runner.xcscheme
│ │ │ │ └── Runner.xcworkspace/
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata/
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ ├── pubspec.yaml
│ │ │ ├── web/
│ │ │ │ ├── index.html
│ │ │ │ └── manifest.json
│ │ │ └── windows/
│ │ │ ├── .gitignore
│ │ │ ├── CMakeLists.txt
│ │ │ ├── flutter/
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── generated_plugin_registrant.cc
│ │ │ │ ├── generated_plugin_registrant.h
│ │ │ │ └── generated_plugins.cmake
│ │ │ └── runner/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── Runner.rc
│ │ │ ├── flutter_window.cpp
│ │ │ ├── flutter_window.h
│ │ │ ├── main.cpp
│ │ │ ├── resource.h
│ │ │ ├── runner.exe.manifest
│ │ │ ├── utils.cpp
│ │ │ ├── utils.h
│ │ │ ├── win32_window.cpp
│ │ │ └── win32_window.h
│ │ ├── lib/
│ │ │ ├── fix_data/
│ │ │ │ └── fix.yaml
│ │ │ ├── native_dio_adapter.dart
│ │ │ └── src/
│ │ │ ├── conversion_layer_adapter.dart
│ │ │ ├── cronet_adapter.dart
│ │ │ ├── cupertino_adapter.dart
│ │ │ └── native_adapter.dart
│ │ ├── native_dio_adapter.iml
│ │ ├── pubspec.yaml
│ │ └── test/
│ │ ├── client_mock.dart
│ │ └── conversion_layer_adapter_test.dart
│ └── web_adapter/
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── dart_test.yaml
│ ├── dio_web_adapter.iml
│ ├── example/
│ │ └── main.dart
│ ├── lib/
│ │ ├── dio_web_adapter.dart
│ │ └── src/
│ │ ├── adapter.dart
│ │ ├── adapter_impl.dart
│ │ ├── compute.dart
│ │ ├── compute_impl.dart
│ │ ├── dio_impl.dart
│ │ ├── multipart_file.dart
│ │ ├── multipart_file_impl.dart
│ │ ├── progress_stream.dart
│ │ └── progress_stream_impl.dart
│ ├── pubspec.yaml
│ └── test/
│ └── browser_test.dart
├── pubspec.yaml
└── scripts/
├── melos_packages.dart
└── prepare_pinning_certs.sh
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
github: [AlexV525, kuhnroyal]
================================================
FILE: .github/ISSUE_TEMPLATE/bug.yml
================================================
name: 🐞 Bug Report
description: Tell us about something that's not working the way we (probably) intend.
labels: ["s: bug", "h: need triage"]
body:
- type: markdown
attributes:
value: |
🧐 **Guidelines:**
- Search through [existing issues](https://github.com/cfug/dio/issues) first to ensure that this bug has not been reported before.
- Write a descriptive title for your issue. Avoid generic or vague titles such as "Something's not working" or "A couple of problems".
- Keep your issue focused on one single problem. If you have multiple bug reports, please create separate issues for each of them.
- Provide as much context as possible in the fields below. Include screenshots, screen recordings, links, references, or anything else you may consider relevant.
- If you want to ask a question instead of reporting a bug, please use [discussions](https://github.com/cfug/dio/discussions/new) instead.
- type: dropdown
id: package
attributes:
label: Package
description: Which package has a problem?
options:
- dio
- compatibility_layer
- cookie_manager
- http2_adapter
- native_dio_adapter
- web_adapter
validations:
required: true
- type: input
id: version
attributes:
label: Version
placeholder: 1.2.3
description: Which version of that package do you use?
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating-System
description: On which OS does the problem occur?
multiple: true
options:
- Android
- iOS
- Web
- MacOS
- Linux
- Windows
validations:
required: true
- type: dropdown
id: adapter
attributes:
label: Adapter
description: Which adapter(s) are used?
multiple: true
options:
- Default Dio
- NativeAdapter
- Http2Adapter
- ConversionLayerAdapter
validations:
required: true
- type: textarea
id: flutter_info
attributes:
label: Output of `flutter doctor -v`
description: Required when used with Flutter. The input is automatically formatted in code fences
render: shell
- type: input
id: dart_version
attributes:
label: Dart Version
placeholder: 1.2.3
description: Which version of Dart do you use?
validations:
required: false
- type: textarea
id: repro
attributes:
label: Steps to Reproduce
description: How can we see what you're seeing? Specific is terrific.
placeholder: |-
1. foo
2. bar
3. baz
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Result
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual Result
description: Logs? Screenshots? Yes, please.
validations:
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/config.yaml
================================================
blank_issues_enabled: true
================================================
FILE: .github/ISSUE_TEMPLATE/feature.yml
================================================
name: 💡 Feature Request
description: Tell us about a problem dio could solve but doesn't.
labels: ["s: feature"]
body:
- type: textarea
id: problem
attributes:
label: Request Statement
description: What problem could dio solve that it doesn't?
validations:
required: true
- type: textarea
id: expected
attributes:
label: Solution Brainstorm
description: We know you have bright ideas to share ... share away, friend.
validations:
required: false
================================================
FILE: .github/ISSUE_TEMPLATE/infra.yml
================================================
name: 👷 Infra
description: Something is wrong with the CI setup or could be improved
labels: ["infra"]
body:
- type: textarea
id: problem
attributes:
label: Request Statement
validations:
required: true
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
### New Pull Request Checklist
- [ ] I have read the [Documentation](https://pub.dev/documentation/dio/latest/)
- [ ] I have searched for a similar pull request in the [project](https://github.com/cfug/dio/pulls) and found none
- [ ] I have updated this branch with the latest `main` branch to avoid conflicts (via merge from master or rebase)
- [ ] I have added the required tests to prove the fix/feature I'm adding
- [ ] I have updated the documentation (if necessary)
- [ ] I have run the tests without failures
- [ ] I have updated the `CHANGELOG.md` in the corresponding package
### Additional context and info (if any)
================================================
FILE: .github/dependabot.yaml
================================================
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "infra"
- "github-actions"
================================================
FILE: .github/workflows/check_issues_access.yml
================================================
# Not allow users without write access to create "infra" or blank issues.
name: Check issues access
on:
issues:
types: [ opened, reopened, edited ]
jobs:
verify_access:
runs-on: ubuntu-latest
if: ${{ join(github.event.issue.labels) == '' || contains(github.event.issue.labels.*.name, 'infra')}}
steps:
- uses: actions-cool/check-user-permission@v2.3.0
id: checkUser
with:
require: 'write'
- name: Write comment
if: steps.checkUser.outputs.require-result == 'false'
uses: actions-cool/issues-helper@v3.7.6
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.event.issue.user.login }} Infra and blank issues are only available for moderators. You're apparently using the wrong issue template.
> Infra 和空白 issue 仅供管理人员使用,请选择其他 issue 模板创建 issue。
- name: Close issue
if: steps.checkUser.outputs.require-result == 'false'
uses: actions-cool/issues-helper@v3.7.6
with:
actions: 'close-issue'
issue-number: ${{ github.event.issue.number }}
- name: Lock issue
if: steps.checkUser.outputs.require-result == 'false'
uses: actions-cool/issues-helper@v3.7.6
with:
actions: 'lock-issue'
issue-number: ${{ github.event.issue.number }}
lock-reason: 'off-topic'
================================================
FILE: .github/workflows/coverage_base.yml
================================================
name: 'coverage_baseline'
# The code-coverage-report-action uses workflow artifacts to store the coverage report.
# The action will upload the coverage report as an artifact,
# and the action will also download the coverage report from the artifact in PRs.
# The action will then compare the coverage report from the PR with the coverage report from the base branch.
# For this to work, the action needs to be run on the base branch after each pushed commit
# or at least once before the artifact retention period ends.
on:
# Allow for manual runs
workflow_dispatch:
# Runs at 00:00, on day 1 of the month (every ~30 days)
schedule:
- cron: '0 0 1 * *'
push:
branches:
- main
jobs:
generate:
runs-on: ubuntu-latest
env:
TEST_PRESET: all
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
cache: true
- run: |
chmod +x ./scripts/prepare_pinning_certs.sh
./scripts/prepare_pinning_certs.sh
- name: Install proxy for tests
run: sudo apt-get update && sudo apt-get install -y squid
- run: dart pub get
- uses: bluefireteam/melos-action@v3
with:
run-bootstrap: false
melos-version: '^6.0.0'
- name: Check satisfied packages
run: |
dart ./scripts/melos_packages.dart
echo $(cat .melos_packages) >> $GITHUB_ENV
- name: Melos Bootstrap
run: melos bootstrap
# Tests
- run: ./scripts/prepare_pinning_certs.sh
- name: Install proxy for tests
run: sudo apt-get update && sudo apt-get install -y squid mkcert
- name: Start local httpbun
run: |
mkcert -install
mkcert -cert-file '/tmp/cert.pem' -key-file '/tmp/key.pem' httpbun.local
echo '127.0.0.1 httpbun.local' | sudo tee --append /etc/hosts
docker run \
--name httpbun \
--detach \
--publish 443:443 \
--volume /tmp:/tmp:ro \
--env HTTPBUN_TLS_CERT=/tmp/cert.pem \
--env HTTPBUN_TLS_KEY=/tmp/key.pem \
--pull always \
sharat87/httpbun
sleep 1
curl --fail --silent --show-error https://httpbun.local/any
- name: Use httpbun.local for tests
run: melos run httpbun:local
- name: '[Verify step] Test Dart packages [VM]'
run: melos run test:vm
- name: Use httpbun.com for Web/Flutter tests
run: melos run httpbun:com
- name: '[Verify step] Test Dart packages [Chrome]'
run: melos run test:web:chrome
- name: '[Verify step] Test Dart packages [Firefox]'
run: melos run test:web:firefox
- name: '[Verify step] Test Flutter packages'
run: melos run test:flutter
- name: '[Coverage] Generate report'
run: melos run coverage:combine
- uses: clearlyip/code-coverage-report-action@v6
with:
filename: 'coverage/cobertura.xml'
================================================
FILE: .github/workflows/coverage_comment.yml
================================================
name: 'coverage_comment'
# This workflow runs after the 'Verify packages abilities' workflow is completed for a pull request.
# The workflow downloads the coverage report if the 'Verify packages abilities' workflow was successful.
# The workflow then adds a comment to the PR with the coverage report.
on:
workflow_run:
workflows: ['Verify packages abilities']
types:
- completed
jobs:
download_coverage:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v18
with:
workflow: tests.yml
workflow_conclusion: success
run_id: ${{ github.event.workflow_run.id }}
name: code-coverage-results
- name: Determine PR number
id: pr-number
run: |
PR_NUMBER=$(cat pr_number.txt)
echo "Found PR:$PR_NUMBER"
echo "value=$PR_NUMBER" >> $GITHUB_OUTPUT
- name: Add PR comment
uses: marocchino/sticky-pull-request-comment@v3
with:
number: ${{ steps.pr-number.outputs.value }}
recreate: true
path: code-coverage-results.md
================================================
FILE: .github/workflows/publish.yml
================================================
name: Publish from comments
on:
issue_comment:
types: [created]
jobs:
publish:
# https://github.com/cfug/dio/issues/1633
if: github.event.issue.number == 1633
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.CFUG_PUBLISHER }}
- uses: dart-lang/setup-dart@v1.4
- uses: cfug/dio_issue_release_action@v2
with:
github-token: ${{ secrets.CFUG_PUBLISHER }}
pub-credentials-json: ${{ secrets.CREDENTIAL_JSON }}
================================================
FILE: .github/workflows/tests.yml
================================================
name: Verify packages abilities
on:
push:
branches:
- main
- '6.0.0'
paths-ignore:
- "**.md"
pull_request:
branches:
- main
- '6.0.0'
paths-ignore:
- "**.md"
# Ensure that new pushes/updates cancel running jobs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
workflows:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [ min, stable, beta ]
env:
TEST_PRESET: all
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
cache: true
flutter-version: ${{ matrix.sdk == 'min' && '3.3.0' || '' }}
channel: ${{ matrix.sdk == 'min' && '' || matrix.channel }}
- run: |
echo TARGET_DART_SDK=${{ matrix.sdk }} >> $GITHUB_ENV
- name: Prepare dependencies for the project management
run: dart pub get
- uses: bluefireteam/melos-action@v3
with:
run-bootstrap: false
melos-version: ${{ matrix.sdk == 'min' && '3.4.0' || '^6.0.0' }}
- name: Remove dio_web_adapter overrides
if: ${{ matrix.sdk == 'min' }}
run: rm -rf plugins/web_adapter
- name: Check satisfied packages
run: |
dart ./scripts/melos_packages.dart
echo $(cat .melos_packages) >> $GITHUB_ENV
- name: Melos Bootstrap
run: melos bootstrap
- name: '[Verify step] Format'
if: ${{ matrix.sdk == 'stable' }}
run: melos run format
- name: '[Verify step] Analyze packages'
if: ${{ matrix.sdk == 'stable' }}
run: melos run analyze
- name: '[Verify step] Publish dry-run'
if: ${{ matrix.sdk == 'stable' }}
run: melos run publish-dry-run
# Tests
- run: ./scripts/prepare_pinning_certs.sh
- name: Install proxy for tests
run: sudo apt-get update && sudo apt-get install -y squid mkcert
- name: Start local httpbun
run: |
mkcert -install
mkcert -cert-file '/tmp/cert.pem' -key-file '/tmp/key.pem' httpbun.local
echo '127.0.0.1 httpbun.local' | sudo tee --append /etc/hosts
docker run \
--name httpbun \
--detach \
--publish 443:443 \
--volume /tmp:/tmp:ro \
--env HTTPBUN_TLS_CERT=/tmp/cert.pem \
--env HTTPBUN_TLS_KEY=/tmp/key.pem \
--pull always \
sharat87/httpbun
sleep 1
curl --fail --silent --show-error https://httpbun.local/any
- name: Use httpbun.local for tests
run: melos run httpbun:local
- name: '[Verify step] Test Dart packages [VM]'
run: melos run test:vm
- name: Use httpbun.com for Web/Flutter tests
run: melos run httpbun:com
- name: '[Verify step] Test Dart packages [Chrome]'
run: melos run test:web:chrome
- name: '[Verify step] Test Dart packages [Firefox]'
run: melos run test:web:firefox
- name: '[Verify step] Test Flutter packages'
run: melos run test:flutter
- uses: actions/setup-java@v5
if: ${{ matrix.sdk == 'stable' }}
with:
distribution: 'adopt'
java-version: '17'
- name: '[Verify step] Build Flutter APK'
if: ${{ matrix.sdk == 'stable' }}
run: melos run build:example:apk
# Coverage
- name: '[Coverage] Format & print test coverage'
if: ${{ matrix.sdk == 'stable' }}
run: melos run coverage:show
- name: '[Coverage] Create Report'
uses: clearlyip/code-coverage-report-action@v6
id: code_coverage_report
if: ${{ matrix.sdk == 'stable' && github.actor != 'dependabot[bot]'}}
with:
artifact_download_workflow_names: 'Verify packages abilities,coverage_baseline'
filename: 'coverage/cobertura.xml'
only_list_changed_files: true
- name: '[Coverage] Write PR number to file'
if: ${{ matrix.sdk == 'stable' && github.actor != 'dependabot[bot]'}}
run: echo ${{ github.event.number }} > pr_number.txt
- name: '[Coverage] Upload'
if: ${{ matrix.sdk == 'stable' && github.actor != 'dependabot[bot]'}}
uses: actions/upload-artifact@v7
with:
name: code-coverage-results
path: |
coverage/cobertura.xml
code-coverage-results.md
pr_number.txt
================================================
FILE: .gitignore
================================================
# Files and directories created by pub
.packages
.dart_tool/
.pub/
.example/flutter.png
build/
# Remove the following pattern if you wish to check in your lock file
pubspec.lock
pubspec_overrides.yaml
# Directory created by dartdoc
doc/api/
.cookies/
.vscode/
# Miscellaneous
.DS_Store
**/DerivedData/
# IDEA configurations
/.idea/*
!/.idea/dio.iml
!/.idea/modules.xml
# Coverage
coverage
# Melos
**/.melos_package
.melos_packages
melos_overrides.yaml
# FVM Version Cache
.fvm/
.fvmrc
================================================
FILE: .idea/modules.xml
================================================
================================================
FILE: CODEOWNERS
================================================
* @cfug/dio-core
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to participate in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community includes:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct that could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[cfug-team@googlegroups.com](mailto:cfug-team@googlegroups.com).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: COMPATIBILITY_POLICY.md
================================================
# Compatibility Policy
As an open-source project, all activities happened when the maintainers have spare time and energy.
The support range is limited due to the above condition.
Therefore, we have a general compatibility policy to help people
that are not actively adapting SDK updates or intended to use any old SDKs to acknowledge the support range.
## Policy Details
For all packages, the oldest Dart SDK we typically support
is one that was **released less than 2 years ago**.
### Exceptions
- The minimum SDK version will follow the dependencies' requirement.
For example: `http2: ^2.1.0` requires Dart SDK >=3.0.0.
- The implementation can no longer compatible between the latest and previous SDKs.
- Previous SDKs have security issues that require to use a new version.
To raise your suggestions and reports, use the issue tracker
or contact cfug-team@googlegroups.com if you want to do this privately.
================================================
FILE: CONTRIBUTING-ZH.md
================================================
# 贡献指南
Language: [English](CONTRIBUTING.md) | 简体中文
首先,感谢您考虑为 `dio` 项目做出贡献!像这样的开源项目得以成长和繁荣,多亏了像您这样的贡献者。无论您是在修复错误、添加新功能、改进文档还是报告问题,每一份贡献都是宝贵和值得赞赏的。
本文档提供了一些指南,以帮助确保您的贡献尽可能有效。在提交您的贡献之前,请花一点时间阅读这些指南。
请记住,每个为这个项目做出贡献的人都需要遵循我们的行为准则。这有助于确保所有贡献者的积极和包容环境。
再次感谢您的贡献,我们期待看到您将为 `dio` 项目带来什么!
## 创建好的工单
> [!TIP]
> 在创建新问题之前,搜索已有的工单和拉取请求以避免重复是一个好习惯。
### 错误报告
报告错误时,请包括以下信息:
1. **标题**:简短描述性的错误标题。
2. **包**:指定有问题的包。
3. **版本**:您正在使用的包版本。
4. **操作系统**:出现问题的操作系统。
5. **适配器**:指定使用的适配器。
6. **`flutter doctor -v` 的输出**:使用 Flutter 时需要。
7. **Dart 版本**:您使用的 Dart 版本。
8. **重现步骤**:详细步骤说明如何重现错误。
9. **预期结果**:您期望发生的事情。
10. **实际结果**:实际发生的事情。包括日志、屏幕截图或任何其他相关信息。
### 功能请求
请求新功能时,请包括以下信息:
1. **标题**:功能请求的简短描述性标题。
2. **请求声明**:描述您认为 `dio` 项目能解决但目前没有解决的问题。
3. **解决方案头脑风暴**:分享您的想法,关于如何解决问题。如果您没有特定的解决方案,那也没关系!
> [!TIP]
> 记住,您提供的信息越多,我们就越容易理解和解决问题。感谢您的贡献!
> 请避免评论旧的、已关闭的工单。如果旧问题似乎与您的问题有关但并未完全解决您的问题,最好开一个新工单并引用旧的。
## 开发
此项目使用 [Melos](https://github.com/invertase/melos) 管理单体仓库和大多数任务。Melos 是一个为 Dart 和 Flutter 的多包项目优化工作流的工具。有关如何使用 Melos 的更多信息,请参阅 [Melos 文档](https://melos.invertase.dev)。
### 设置
开始之前,您需要全局安装 Melos:
```bash
dart pub global activate melos
```
在安装 Melos 后,可以克隆仓库并安装依赖项:
```bash
git clone https://github.com/cfug/dio.git
cd dio
melos bootstrap
```
## 提交更改
在以拉取请求提交您的更改之前,请确保格式化和分析您的代码并运行所有测试。以下是您应该了解的主要 melos 脚本:
### 代码质量
要格式化(和修复)所有包,请运行:
```bash
melos run format
# 或者
melos run format:fix
```
要分析所有包,请运行:
```bash
melos run analyze
```
### 测试
要运行所有测试,请使用:
```bash
melos run test
```
可以使用适当的脚本运行单个测试目标:
```bash
melos run test:vm
melos run test:web
melos run test:web:chrome
melos run test:web:firefox
```
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing Guidelines
Language: English | [简体中文](CONTRIBUTING-ZH.md)
First of all, thank you for considering contributing to the `dio` project! Open source projects like this one grow and thrive thanks to the contributions from people like you. Whether you're fixing bugs, adding new features, improving the documentation, or even reporting issues, every contribution is valuable and appreciated.
This document provides some guidelines to help ensure that your contributions are as effective as possible. Please take a moment to read through these guidelines before submitting your contribution.
Remember, everyone contributing to this project is expected to follow our code of conduct. This helps ensure a positive and inclusive environment for all contributors.
Thank you again for your contributions, and we look forward to seeing what you will bring to the `dio` project!
## Creating Good Tickets
> [!TIP]
> Before creating a new issue, it's a good practice to search for open tickets and pull requests to avoid duplicates.
### Bug Reports
When reporting a bug, please include the following information:
1. **Title**: A brief, descriptive title for the bug.
2. **Package**: Specify which package has the problem.
3. **Version**: The version of the package you are using.
4. **Operating System**: The OS on which the problem occurs.
5. **Adapter**: Specify which adapter(s) are used.
6. **Output of `flutter doctor -v`**: Required when used with Flutter.
7. **Dart Version**: The version of Dart you are using.
8. **Steps to Reproduce**: Detailed steps on how to reproduce the bug.
9. **Expected Result**: What you expected to happen.
10. **Actual Result**: What actually happened. Include logs, screenshots, or any other relevant information.
### Feature Requests
When requesting a new feature, please include the following information:
1. **Title**: A brief, descriptive title for the feature request.
2. **Request Statement**: Describe the problem that you believe the `dio` project could solve but currently doesn't.
3. **Solution Brainstorm**: Share your ideas on how the problem could be solved. If you don't have a specific solution in mind, that's okay too!
> [!TIP]
> Remember, the more information you provide, the easier it is for us to understand and address the issue. Thank you for your contributions!
> Please refrain from commenting on old, closed tickets. If an old issue seems related but doesn't fully address your problem, it's best to open a new ticket and reference the old one instead.
## Development
This project uses [Melos](https://github.com/invertase/melos) to manage the mono-repo and most tasks. Melos is a tool that optimizes the workflow for multi-package Dart and Flutter projects. For more information on how to use Melos, please refer to the [Melos documentation](https://melos.invertase.dev).
### Setup
To get started, you'll need to install Melos globally:
```bash
dart pub global activate melos
```
After installing Melos, you can clone the repository and install the dependencies:
```bash
git clone https://github.com/cfug/dio.git
cd dio
melos bootstrap
```
## Submitting changes
Before submitting your changes as a pull request, please make sure to format and analyze your and run the all tests. Here are the main melos scripts you should be aware of:
### Code quality
To format (and fix) all packages, run:
```bash
melos run format
# OR
melos run format:fix
```
To analyze all packages, run:
```bash
melos run analyze
```
### Testing
To run all tests, use:
```bash
melos run test
```
Individual test targets can be run with the appropriate scripts:
```bash
melos run test:vm
melos run test:web
melos run test:web:chrome
melos run test:web:firefox
```
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Wen Du (wendux)
Copyright (c) 2022 The CFUG Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README-ZH.md
================================================
# dio
Language: [English](README.md) | 简体中文
此处是 **dio** 项目的基础仓库。请前往项目各自的路径查看指引。
> 别忘了为你发布的与 dio 相关的 package 添加
> [#dio](https://pub.flutter-io.cn/packages?q=topic%3Adio) 分类标签!
> 了解更多:https://dart.cn/tools/pub/pubspec#topics
## 版本问题
**在你更新之前:大版本和次要版本可能会包含不兼容的重大改动。
请阅读 [迁移指南][] 了解完整的重大变更内容。**
想要了解我们的兼容性政策,请参阅 [兼容性政策][]文档。
[迁移指南]: https://pub.flutter-io.cn/documentation/dio/latest/topics/Migration%20Guide-topic.html
[兼容性政策]: COMPATIBILITY_POLICY.md
## 所有依赖
### dio
- dio: [链接](dio)
[](https://pub.flutter-io.cn/packages/dio)
### 插件
- cookie_manager: [链接](plugins/cookie_manager)
[](https://pub.flutter-io.cn/packages/dio_cookie_manager)
- compatibility_layer: [链接](plugins/compatibility_layer)
[](https://pub.flutter-io.cn/packages/dio_compatibility_layer)
- http2_adapter: [链接](plugins/http2_adapter)
[](https://pub.flutter-io.cn/packages/dio_http2_adapter)
- native_dio_adapter: [链接](plugins/native_dio_adapter)
[](https://pub.dev/packages/native_dio_adapter)
- web_adapter: [链接](plugins/web_adapter)
[](https://pub.dev/packages/dio_web_adapter)
### 示例
- example: [链接](example_dart)
- example_flutter_app: [链接](example_flutter_app)
## 版权 & 协议
该项目由 [@flutterchina](https://github.com/flutterchina)
开源组织的 [@wendux](https://github.com/wendux) 创作,
并在 2023 年转移至
[Flutter 中文社区 (@cfug)](https://github.com/cfug) 组织进行维护。
该项目遵循 [MIT 开源协议](LICENSE)。
================================================
FILE: README.md
================================================
# dio
Language: English | [简体中文](README-ZH.md)
This is the base repo of the **dio** project.
Please move specific paths for project instructions.
> Don't forget to add [#dio](https://pub.dev/packages?q=topic%3Adio)
> topic to your published dio related packages!
> See more: https://dart.dev/tools/pub/pubspec#topics
## Versioning
**Before you upgrade: Breaking changes might happen in major and minor versions of packages.
See the [Migration Guide][] for the complete breaking changes list.**
To know about our compatibility policy, see the [Compatibility Policy][] doc.
[Migration Guide]: https://pub.dev/documentation/dio/latest/topics/Migration%20Guide-topic.html
[Compatibility Policy]: COMPATIBILITY_POLICY.md
## All Packages
### dio
- dio: [link](dio)
[](https://pub.dev/packages/dio)
### Plugins
- cookie_manager: [link](plugins/cookie_manager)
[](https://pub.dev/packages/dio_cookie_manager)
- compatibility_layer: [link](plugins/compatibility_layer)
[](https://pub.dev/packages/dio_compatibility_layer)
- http2_adapter: [link](plugins/http2_adapter)
[](https://pub.dev/packages/dio_http2_adapter)
- native_dio_adapter: [link](plugins/native_dio_adapter)
[](https://pub.dev/packages/native_dio_adapter)
- web_adapter: [link](plugins/web_adapter)
[](https://pub.dev/packages/dio_web_adapter)
### Examples
- example: [link](example_dart)
- example_flutter_app: [link](example_flutter_app)
## Copyright & License
The project and its underlying projects
are originally authored by
[@wendux](https://github.com/wendux)
with the organization
[@flutterchina](https://github.com/flutterchina),
started being maintained by
[Chinese Flutter User Group (@cfug)](https://github.com/cfug)
since 2023.
The project consents [the MIT license](LICENSE).
## Star History
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Supported Versions
| Version | Supported |
|---------|-----------|
| >=5.0 | ✅ |
| < 5.0 | ❌ |
## Reporting a Vulnerability
Contact cfug-team@googlegroups.com with your vulnerability report.
================================================
FILE: analysis_options.yaml
================================================
include: package:lints/recommended.yaml
analyzer:
errors:
always_declare_return_types: error
always_put_control_body_on_new_line: error
avoid_renaming_method_parameters: error
avoid_void_async: error
camel_case_types: error
constant_identifier_names: error
deprecated_member_use_from_same_package: ignore
non_constant_identifier_names: error
prefer_single_quotes: error
require_trailing_commas: error
todo: ignore
linter:
rules:
always_declare_return_types: true
always_put_control_body_on_new_line: true
avoid_renaming_method_parameters: true
avoid_unnecessary_containers: true
avoid_void_async: true
curly_braces_in_flow_control_structures: true
directives_ordering: true
library_annotations: false
prefer_const_constructors: true
prefer_const_constructors_in_immutables: false
prefer_final_fields: true
prefer_final_in_for_each: true
prefer_final_locals: true
prefer_relative_imports: true
prefer_single_quotes: true
require_trailing_commas: true
sort_constructors_first: true
sort_unnamed_constructors_first: true
unnecessary_await_in_return: true
unnecessary_breaks: true
unnecessary_late: true
unnecessary_library_name: false
unnecessary_parenthesis: true
================================================
FILE: dio/.gitignore
================================================
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
build/
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
# Project related.
test/*_pinning.txt
coverage
================================================
FILE: dio/CHANGELOG.md
================================================
# CHANGELOG
**Before you upgrade: Breaking changes might happen in major and minor versions of packages.
See the [Migration Guide][] for the complete breaking changes list.**
## Unreleased
*None.*
## 5.9.2
- Fixes `kIsWeb` across different Flutter SDKs.
- Provides `httpVersion` in `Response.extra` when using `IOHttpClientAdapter`.
## 5.9.1
- Add `requestUrl` and `responseUrl` parameters to `LogInterceptor` for more precise control over URL logging.
- Fix `QueuedInterceptor` hanging indefinitely when interceptor callbacks throw synchronous exceptions.
## 5.9.0
- Do not allow updating the error field after a cancel token has canceled.
- Allow passing an initial interceptors list to the constructor of `Interceptors`.
- Use `package:mime` to help determine the `content-type` of `MultipartFile` base on the provided `filename`.
## 5.8.0+1
- Raise the version constraint of `dio_web_adapter`.
## 5.8.0
- Update comments and strings with `MultipartFile`.
- Removes redundant warnings when composing request options on Web.
- Fixes boundary inconsistency in `FormData.clone()`.
- Support `FileAccessMode` in `Dio.download` and `Dio.downloadUri` to change download file opening mode.
- Fix `ListParam` equality by using the `DeepCollectionEquality`.
- Enables configuring the logging details of `DioException` globally and locally.
- Enables using `Dio.clone` to reuse base options, client adapter, interceptors, and transformer,
in a new `Dio` instance.
## 5.7.0
- Graceful handling of responses with nonzero `Content-Length`, `Content-Type` that is json, and empty payload.
- Empty responses are now transformed to `null`.
## 5.6.0
- Supports the WASM environment. Users should upgrade the adapter with
`dart pub upgrade` or `flutter pub upgrade` to use the WASM-supported version.
## 5.5.0+1
- Fix WASM compile errors after moving the web implementation to `dio_web_adapter`.
## 5.5.0
- Raise the min Dart SDK version to 2.18.0.
- Add constructor for `DioExceptionType.badCertificate`.
- Create type alias `DioMediaType` for `http_parser`'s `MediaType`.
- Fix the type conversion regression when using `MultipartFile.fromBytes`.
- Split the Web implementation to `package:dio_web_adapter`.
- Add FusedTransformer for improved performance when decoding JSON.
- Set FusedTransformer as the default transformer.
- Improves `InterceptorState.toString()`.
- If the `CancelToken` got canceled before making requests,
throws the exception directly rather than cut actual HTTP requests afterward.
- Catch `MediaType` parse exception in `Transformer.isJsonMimeType`.
- Improves warning logs on the Web platform.
- Improves memory allocating when using `CancelToken`.
## 5.4.3+1
- Fix type promotions for the UTF-8 encoder on previous Dart SDKs.
## 5.4.3
- Remove sockets detach in `IOHttpClientAdapter`.
- Allows to define `FormData.boundaryName` instead of the default `--dio-boundary-`.
## 5.4.2+1
- Revert "Catch sync/async exceptions in interceptors' handlers".
## 5.4.2
- Fix `receiveTimeout` throws exception after the request has been cancelled.
- Catch sync/async exceptions in interceptors' handlers.
- Throws precise `StateError` for handler's duplicated calls.
## 5.4.1
- Provide fix suggestions for `dart fix`.
- Fix `receiveTimeout` for streamed responses.
- Fix cancellation for streamed responses and downloads when using `IOHttpClientAdapter`.
- Fix receive progress for streamed responses and downloads when using `IOHttpClientAdapter`.
- Support relative `baseUrl` on the Web platform.
- Avoid fake uncaught exceptions during debugging with IDEs.
## 5.4.0
- Improve `SyncTransformer`'s stream transform.
- Allow case-sensitive header keys with the `preserveHeaderCase` flag through options.
- Fix `receiveTimeout` for the `IOHttpClientAdapter`.
- Fix `receiveTimeout` for the `download` method of `DioForNative`.
- Improve the stream byte conversion.
## 5.3.4
- Raise warning for `Map`s other than `Map` when encoding request data.
- Improve exception messages.
- Allow `ResponseDecoder` and `RequestEncoder` to be async.
- Ignores `Duration.zero` timeouts.
## 5.3.3
- Fix failing requests throw `DioException`s with `.unknown` instead of `.connectionError` on `SocketException`.
- Removes the accidentally added `options` argument for `Options.compose`.
- Fix wrong formatting of multi-value header in `BrowserHttpClientAdapter`.
- Add warning in debug mode when trying to send data with a `GET` request in web.
- Reduce cases in which browsers would trigger a CORS preflight request.
- Add warnings in debug mode when using `sendTimeout` and `onSendProgress` with an empty request body.
- Fix `receiveTimeout` not working correctly on web.
- Fix `ImplyContentTypeInterceptor` can be removed by `Interceptors.clear()` by default.
## 5.3.2
- Revert removed `download` for `DioMixin`.
- Fix for `Dio.download` not cleaning the file on data handling error.
## 5.3.1
- Improve package descriptions and code formats.
- Improve comments.
- Fix error when cloning `MultipartFile` from `FormData` with regression test.
- Deprecate `MultipartFile` constructor in favor `MultipartFile.fromStream`.
- Add `FormData.clone`.
## 5.3.0
- Remove `http` from `dev_dependencies`.
- Add support for cloning `MultipartFile` from `FormData`.
- Only produce null response body when `ResponseType.json`.
## 5.2.1+1
- Fix changelog on pub.dev.
## 5.2.1
- Revert changes to handling of `List` body data.
## 5.2.0+1
- Fix `DioErrorType` deprecation hint.
## 5.2.0
- Make `LogInterceptor` prints in DEBUG mode (when the assertion is enabled) by default.
- Deprecate `DioError` in favor of `DioException`.
- Fix `IOHttpClientAdapter.onHttpClientCreate` Repeated calls
- `IOHttpClientAdapter.onHttpClientCreate` has been deprecated and is scheduled for removal in
Dio 6.0.0 - Please use the replacement `IOHttpClientAdapter.createHttpClient` instead.
- Using `CancelToken` no longer closes and re-creates `HttpClient` for each request when `IOHttpClientAdapter` is used.
- Fix timeout handling for browser `receiveTimeout`.
- Improve performance when sending binary data (`List`/`Uint8List`).
## 5.1.2
- Allow `FormData` to send a null entry value as an empty string.
## 5.1.1
- Revert changes to `CancelToken.cancel()` behavior, as a result the `DioError`
provided by the `CancelToken.cancelError` does not contain useful information
when the token was not used with a request.
- Fix wrong `ListFormat` being used for comparison during encoding of `FormData`
and `application/x-www-form-urlencoded`, resulting in potential wrong output encoding
for `ListFormat.multi` and `ListFormat.multiCompatible` since Dio 4.0.x.
- Respect `Options.listFormat` when encoding `x-www-url-encoded` content.
## 5.1.0
- Fix double-completion when using `connectionTimeout` on web platform.
- Allow defining adapter methods through their constructors.
- Fix `FormData` encoding regression for maps with dynamic keys, introduced in 5.0.3.
- Mark several static `DioMixin` functions as `@internal`.
- Make `DioError.stackTrace` non-nullable.
- Ensure `DioError.stackTrace` always points to the correct call site.
## 5.0.3
- Imply `List