├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── 1--package-http---failing-connection.md │ ├── 2--package-http---i-found-a-bug.md │ ├── 3--package-http---i-d-like-a-new-feature.md │ ├── 4--package-cronet_http---i-found-a-bug.md │ ├── 5--package-cronet_http---i-d-like-a-new-feature.md │ ├── 6--package-cupertino_http---i-found-a-bug.md │ ├── 7--package-cupertino_http---i-d-like-a-new-feature.md │ ├── http2.md │ ├── http_multi_server.md │ ├── http_parser.md │ └── web_socket_channel.md ├── dependabot.yml ├── labeler.yml └── workflows │ ├── cronet.yml │ ├── cupertino.yml │ ├── dart.yml │ ├── health.yaml │ ├── http2.yaml │ ├── http_multi_server.yaml │ ├── http_parser.yaml │ ├── no-response.yml │ ├── okhttp.yaml │ ├── post_summaries.yaml │ ├── publish.yaml │ ├── pull_request_label.yml │ └── web_socket_channel.yaml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── mono_repo.yaml ├── pkgs ├── cronet_http │ ├── .gitattributes │ ├── .gitignore │ ├── .metadata │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── android │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── consumer-rules.pro │ │ ├── settings.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── kotlin │ │ │ └── io │ │ │ └── flutter │ │ │ └── plugins │ │ │ └── cronet_http │ │ │ └── UrlRequestCallbackProxy.kt │ ├── example │ │ ├── .gitignore │ │ ├── README.md │ │ ├── android │ │ │ ├── .gitignore │ │ │ ├── app │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ ├── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ ├── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ ├── kotlin │ │ │ │ │ │ └── io │ │ │ │ │ │ │ └── flutter │ │ │ │ │ │ │ └── cronet_http_example │ │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ │ └── res │ │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ │ │ └── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── profile │ │ │ │ │ └── AndroidManifest.xml │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ └── gradle-wrapper.properties │ │ │ └── settings.gradle │ │ ├── integration_test │ │ │ ├── client_profile_test.dart │ │ │ ├── client_test.dart │ │ │ └── cronet_configuration_test.dart │ │ ├── lib │ │ │ ├── book.dart │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── jnigen.yaml │ ├── lib │ │ ├── cronet_http.dart │ │ └── src │ │ │ ├── cronet_client.dart │ │ │ └── jni │ │ │ └── jni_bindings.dart │ └── pubspec.yaml ├── cupertino_http │ ├── .gitattributes │ ├── .gitignore │ ├── .metadata │ ├── CHANGELOG.md │ ├── DEVELOPMENT.md │ ├── LICENSE │ ├── README.md │ ├── darwin │ │ ├── cupertino_http.podspec │ │ └── cupertino_http │ │ │ └── Sources │ │ │ └── cupertino_http │ │ │ └── native_cupertino_bindings.m │ ├── example │ │ ├── .gitignore │ │ ├── .metadata │ │ ├── README.md │ │ ├── integration_test │ │ │ ├── client_conformance_test.dart │ │ │ ├── client_profile_test.dart │ │ │ ├── client_test.dart │ │ │ ├── http_url_response_test.dart │ │ │ ├── main.dart │ │ │ ├── mutable_url_request_test.dart │ │ │ ├── ns_error_client_exception.dart │ │ │ ├── url_cache_test.dart │ │ │ ├── url_request_test.dart │ │ │ ├── url_response_test.dart │ │ │ ├── url_session_configuration_test.dart │ │ │ ├── url_session_delegate_test.dart │ │ │ ├── url_session_task_test.dart │ │ │ ├── url_session_test.dart │ │ │ ├── utils_test.dart │ │ │ ├── web_socket_conformance_test.dart │ │ │ └── web_socket_test.dart │ │ ├── ios │ │ │ ├── .gitignore │ │ │ ├── Flutter │ │ │ │ ├── AppFrameworkInfo.plist │ │ │ │ ├── Debug.xcconfig │ │ │ │ └── Release.xcconfig │ │ │ ├── Podfile │ │ │ ├── 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 │ │ │ └── Runner │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Assets.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ │ └── LaunchImage.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── LaunchImage.png │ │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ │ └── README.md │ │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ │ ├── Info.plist │ │ │ │ └── Runner-Bridging-Header.h │ │ ├── lib │ │ │ ├── book.dart │ │ │ └── main.dart │ │ ├── macos │ │ │ ├── .gitignore │ │ │ ├── Flutter │ │ │ │ ├── Flutter-Debug.xcconfig │ │ │ │ └── Flutter-Release.xcconfig │ │ │ ├── Podfile │ │ │ ├── Runner.xcodeproj │ │ │ │ ├── project.pbxproj │ │ │ │ ├── project.xcworkspace │ │ │ │ │ └── xcshareddata │ │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ └── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ └── Runner.xcscheme │ │ │ ├── Runner.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── Runner │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── app_icon_1024.png │ │ │ │ │ ├── app_icon_128.png │ │ │ │ │ ├── app_icon_16.png │ │ │ │ │ ├── app_icon_256.png │ │ │ │ │ ├── app_icon_32.png │ │ │ │ │ ├── app_icon_512.png │ │ │ │ │ └── app_icon_64.png │ │ │ │ ├── Base.lproj │ │ │ │ └── MainMenu.xib │ │ │ │ ├── Configs │ │ │ │ ├── AppInfo.xcconfig │ │ │ │ ├── Debug.xcconfig │ │ │ │ ├── Release.xcconfig │ │ │ │ └── Warnings.xcconfig │ │ │ │ ├── DebugProfile.entitlements │ │ │ │ ├── Info.plist │ │ │ │ ├── MainFlutterWindow.swift │ │ │ │ └── Release.entitlements │ │ └── pubspec.yaml │ ├── ffigen.yaml │ ├── img │ │ └── architecture.svg │ ├── lib │ │ ├── cupertino_http.dart │ │ └── src │ │ │ ├── cupertino_api.dart │ │ │ ├── cupertino_client.dart │ │ │ ├── cupertino_web_socket.dart │ │ │ ├── native_cupertino_bindings.dart │ │ │ └── utils.dart │ └── pubspec.yaml ├── flutter_http_example │ ├── .gitignore │ ├── .metadata │ ├── README.md │ ├── android │ │ ├── .gitignore │ │ ├── app │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── flutter_http_example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── res │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── values-night │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values │ │ │ │ │ └── styles.xml │ │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ └── settings.gradle │ ├── ios │ │ ├── .gitignore │ │ ├── Flutter │ │ │ ├── AppFrameworkInfo.plist │ │ │ ├── Debug.xcconfig │ │ │ └── Release.xcconfig │ │ ├── Podfile │ │ ├── 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 │ │ ├── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ │ └── LaunchImage.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── LaunchImage.png │ │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ │ └── README.md │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ └── Runner-Bridging-Header.h │ │ └── RunnerTests │ │ │ └── RunnerTests.swift │ ├── lib │ │ ├── book.dart │ │ ├── http_client_factory.dart │ │ ├── http_client_factory_web.dart │ │ └── 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.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── app_icon_1024.png │ │ │ │ │ ├── app_icon_128.png │ │ │ │ │ ├── app_icon_16.png │ │ │ │ │ ├── app_icon_256.png │ │ │ │ │ ├── app_icon_32.png │ │ │ │ │ ├── app_icon_512.png │ │ │ │ │ └── app_icon_64.png │ │ │ ├── Base.lproj │ │ │ │ └── MainMenu.xib │ │ │ ├── Configs │ │ │ │ ├── AppInfo.xcconfig │ │ │ │ ├── Debug.xcconfig │ │ │ │ ├── Release.xcconfig │ │ │ │ └── Warnings.xcconfig │ │ │ ├── DebugProfile.entitlements │ │ │ ├── Info.plist │ │ │ ├── MainFlutterWindow.swift │ │ │ └── Release.entitlements │ │ └── RunnerTests │ │ │ └── RunnerTests.swift │ ├── mono_pkg.yaml │ ├── pubspec.yaml │ ├── test │ │ └── widget_test.dart │ ├── web │ │ ├── favicon.png │ │ ├── icons │ │ │ ├── Icon-192.png │ │ │ ├── Icon-512.png │ │ │ ├── Icon-maskable-192.png │ │ │ └── Icon-maskable-512.png │ │ ├── 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 │ │ ├── resources │ │ └── app_icon.ico │ │ ├── runner.exe.manifest │ │ ├── utils.cpp │ │ ├── utils.h │ │ ├── win32_window.cpp │ │ └── win32_window.h ├── http │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── example │ │ ├── main.dart │ │ └── retry.dart │ ├── lib │ │ ├── browser_client.dart │ │ ├── http.dart │ │ ├── io_client.dart │ │ ├── retry.dart │ │ ├── src │ │ │ ├── abortable.dart │ │ │ ├── base_client.dart │ │ │ ├── base_request.dart │ │ │ ├── base_response.dart │ │ │ ├── boundary_characters.dart │ │ │ ├── browser_client.dart │ │ │ ├── byte_stream.dart │ │ │ ├── client.dart │ │ │ ├── client_stub.dart │ │ │ ├── exception.dart │ │ │ ├── io_client.dart │ │ │ ├── io_streamed_response.dart │ │ │ ├── mock_client.dart │ │ │ ├── multipart_file.dart │ │ │ ├── multipart_file_io.dart │ │ │ ├── multipart_file_stub.dart │ │ │ ├── multipart_request.dart │ │ │ ├── request.dart │ │ │ ├── response.dart │ │ │ ├── streamed_request.dart │ │ │ ├── streamed_response.dart │ │ │ └── utils.dart │ │ └── testing.dart │ ├── mono_pkg.yaml │ ├── pubspec.yaml │ └── test │ │ ├── html │ │ ├── client_conformance_test.dart │ │ ├── client_test.dart │ │ ├── streamed_request_test.dart │ │ └── utils.dart │ │ ├── http_retry_test.dart │ │ ├── io │ │ ├── client_conformance_test.dart │ │ ├── client_test.dart │ │ ├── http_test.dart │ │ ├── multipart_test.dart │ │ ├── request_test.dart │ │ └── streamed_request_test.dart │ │ ├── mock_client_test.dart │ │ ├── multipart_test.dart │ │ ├── no_default_http_client_test.dart │ │ ├── request_test.dart │ │ ├── response_test.dart │ │ ├── streamed_request_test.dart │ │ ├── stub_server.dart │ │ └── utils.dart ├── http2 │ ├── .gitignore │ ├── .test_config │ ├── AUTHORS │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── example │ │ └── display_headers.dart │ ├── lib │ │ ├── http2.dart │ │ ├── multiprotocol_server.dart │ │ ├── src │ │ │ ├── artificial_server_socket.dart │ │ │ ├── async_utils │ │ │ │ └── async_utils.dart │ │ │ ├── byte_utils.dart │ │ │ ├── connection.dart │ │ │ ├── connection_preface.dart │ │ │ ├── error_handler.dart │ │ │ ├── flowcontrol │ │ │ │ ├── connection_queues.dart │ │ │ │ ├── queue_messages.dart │ │ │ │ ├── stream_queues.dart │ │ │ │ ├── window.dart │ │ │ │ └── window_handler.dart │ │ │ ├── frames │ │ │ │ ├── frame_defragmenter.dart │ │ │ │ ├── frame_reader.dart │ │ │ │ ├── frame_types.dart │ │ │ │ ├── frame_utils.dart │ │ │ │ ├── frame_writer.dart │ │ │ │ └── frames.dart │ │ │ ├── hpack │ │ │ │ ├── hpack.dart │ │ │ │ ├── huffman.dart │ │ │ │ └── huffman_table.dart │ │ │ ├── ping │ │ │ │ └── ping_handler.dart │ │ │ ├── settings │ │ │ │ └── settings.dart │ │ │ ├── streams │ │ │ │ └── stream_handler.dart │ │ │ └── sync_errors.dart │ │ └── transport.dart │ ├── manual_test │ │ └── out_of_stream_ids_test.dart │ ├── pubspec.yaml │ └── test │ │ ├── certificates │ │ ├── server_chain.pem │ │ └── server_key.pem │ │ ├── client_test.dart │ │ ├── multiprotocol_server_test.dart │ │ ├── server_test.dart │ │ ├── src │ │ ├── async_utils │ │ │ └── async_utils_test.dart │ │ ├── connection_preface_test.dart │ │ ├── error_matchers.dart │ │ ├── flowcontrol │ │ │ ├── connection_queues_test.dart │ │ │ ├── mocks.dart │ │ │ ├── mocks.mocks.dart │ │ │ ├── stream_queues_test.dart │ │ │ └── window_handler_test.dart │ │ ├── frames │ │ │ ├── frame_defragmenter_test.dart │ │ │ ├── frame_reader_test.dart │ │ │ ├── frame_writer_reader_test.dart │ │ │ └── frame_writer_test.dart │ │ ├── hpack │ │ │ ├── hpack_test.dart │ │ │ └── huffman_table_test.dart │ │ ├── ping │ │ │ └── ping_handler_test.dart │ │ ├── settings │ │ │ └── settings_handler_test.dart │ │ └── streams │ │ │ ├── helper.dart │ │ │ ├── simple_flow_test.dart │ │ │ ├── simple_push_test.dart │ │ │ └── streams_test.dart │ │ └── transport_test.dart ├── http_client_conformance_tests │ ├── .gitattributes │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── generate_server_wrappers.dart │ ├── example │ │ └── client_test.dart │ ├── lib │ │ ├── http_client_conformance_tests.dart │ │ └── src │ │ │ ├── abort_server.dart │ │ │ ├── abort_server_vm.dart │ │ │ ├── abort_server_web.dart │ │ │ ├── abort_tests.dart │ │ │ ├── close_tests.dart │ │ │ ├── compressed_response_body_server.dart │ │ │ ├── compressed_response_body_server_vm.dart │ │ │ ├── compressed_response_body_server_web.dart │ │ │ ├── compressed_response_body_tests.dart │ │ │ ├── dummy_isolate.dart │ │ │ ├── isolate_test.dart │ │ │ ├── multipart_server.dart │ │ │ ├── multipart_server_vm.dart │ │ │ ├── multipart_server_web.dart │ │ │ ├── multipart_tests.dart │ │ │ ├── multiple_clients_server.dart │ │ │ ├── multiple_clients_server_vm.dart │ │ │ ├── multiple_clients_server_web.dart │ │ │ ├── multiple_clients_tests.dart │ │ │ ├── redirect_server.dart │ │ │ ├── redirect_server_vm.dart │ │ │ ├── redirect_server_web.dart │ │ │ ├── redirect_tests.dart │ │ │ ├── request_body_server.dart │ │ │ ├── request_body_server_vm.dart │ │ │ ├── request_body_server_web.dart │ │ │ ├── request_body_streamed_server.dart │ │ │ ├── request_body_streamed_server_vm.dart │ │ │ ├── request_body_streamed_server_web.dart │ │ │ ├── request_body_streamed_tests.dart │ │ │ ├── request_body_tests.dart │ │ │ ├── request_cookies_server.dart │ │ │ ├── request_cookies_server_vm.dart │ │ │ ├── request_cookies_server_web.dart │ │ │ ├── request_cookies_test.dart │ │ │ ├── request_headers_server.dart │ │ │ ├── request_headers_server_vm.dart │ │ │ ├── request_headers_server_web.dart │ │ │ ├── request_headers_tests.dart │ │ │ ├── request_methods_server.dart │ │ │ ├── request_methods_server_vm.dart │ │ │ ├── request_methods_server_web.dart │ │ │ ├── request_methods_tests.dart │ │ │ ├── response_body_server.dart │ │ │ ├── response_body_server_vm.dart │ │ │ ├── response_body_server_web.dart │ │ │ ├── response_body_streamed_server.dart │ │ │ ├── response_body_streamed_server_vm.dart │ │ │ ├── response_body_streamed_server_web.dart │ │ │ ├── response_body_streamed_test.dart │ │ │ ├── response_body_tests.dart │ │ │ ├── response_cookies_server.dart │ │ │ ├── response_cookies_server_vm.dart │ │ │ ├── response_cookies_server_web.dart │ │ │ ├── response_cookies_test.dart │ │ │ ├── response_headers_server.dart │ │ │ ├── response_headers_server_vm.dart │ │ │ ├── response_headers_server_web.dart │ │ │ ├── response_headers_tests.dart │ │ │ ├── response_status_line_server.dart │ │ │ ├── response_status_line_server_vm.dart │ │ │ ├── response_status_line_server_web.dart │ │ │ ├── response_status_line_tests.dart │ │ │ ├── server_errors_server.dart │ │ │ ├── server_errors_server_vm.dart │ │ │ ├── server_errors_server_web.dart │ │ │ ├── server_errors_test.dart │ │ │ └── server_queue_helpers.dart │ ├── mono_pkg.yaml │ └── pubspec.yaml ├── http_multi_server │ ├── .gitignore │ ├── .test_config │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── example │ │ └── main.dart │ ├── lib │ │ ├── http_multi_server.dart │ │ └── src │ │ │ ├── multi_headers.dart │ │ │ └── utils.dart │ ├── pubspec.yaml │ └── test │ │ └── http_multi_server_test.dart ├── http_parser │ ├── .gitignore │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── example │ │ └── example.dart │ ├── lib │ │ ├── http_parser.dart │ │ └── src │ │ │ ├── authentication_challenge.dart │ │ │ ├── case_insensitive_map.dart │ │ │ ├── chunked_coding.dart │ │ │ ├── chunked_coding │ │ │ ├── charcodes.dart │ │ │ ├── decoder.dart │ │ │ └── encoder.dart │ │ │ ├── http_date.dart │ │ │ ├── media_type.dart │ │ │ ├── scan.dart │ │ │ └── utils.dart │ ├── pubspec.yaml │ └── test │ │ ├── authentication_challenge_test.dart │ │ ├── case_insensitive_map_test.dart │ │ ├── chunked_coding_test.dart │ │ ├── example_test.dart │ │ ├── http_date_test.dart │ │ ├── media_type_test.dart │ │ └── scan_test.dart ├── http_profile │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── lib │ │ ├── http_profile.dart │ │ └── src │ │ │ ├── http_client_request_profile.dart │ │ │ ├── http_profile.dart │ │ │ ├── http_profile_request_data.dart │ │ │ ├── http_profile_response_data.dart │ │ │ └── utils.dart │ ├── mono_pkg.yaml │ ├── pubspec.yaml │ └── test │ │ ├── close_test.dart │ │ ├── http_client_request_profile_test.dart │ │ ├── http_profile_request_data_test.dart │ │ ├── http_profile_response_data_test.dart │ │ └── utils_test.dart ├── ok_http │ ├── .gitignore │ ├── .metadata │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── android │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── settings.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── kotlin │ │ │ └── com │ │ │ └── example │ │ │ └── ok_http │ │ │ ├── AsyncInputStreamReader.kt │ │ │ ├── FixedResponseX509ExtendedKeyManager.kt │ │ │ ├── RedirectInterceptor.kt │ │ │ ├── WebSocketInterceptor.kt │ │ │ └── WebSocketListenerProxy.kt │ ├── example │ │ ├── .gitignore │ │ ├── README.md │ │ ├── analysis_options.yaml │ │ ├── android │ │ │ ├── .gitignore │ │ │ ├── app │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ ├── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ ├── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ ├── kotlin │ │ │ │ │ │ └── com │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── ok_http_example │ │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ │ └── res │ │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ │ │ └── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── profile │ │ │ │ │ └── AndroidManifest.xml │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ └── gradle-wrapper.properties │ │ │ └── settings.gradle │ │ ├── integration_test │ │ │ ├── certificate_test.dart │ │ │ ├── client_configuration_test.dart │ │ │ ├── client_profile_test.dart │ │ │ ├── client_test.dart │ │ │ └── web_socket_test.dart │ │ ├── lib │ │ │ ├── book.dart │ │ │ └── main.dart │ │ ├── pubspec.yaml │ │ └── test_certs │ │ │ ├── README.md │ │ │ ├── server_chain.p12 │ │ │ ├── server_key.p12 │ │ │ └── test-combined.p12 │ ├── jnigen.yaml │ ├── lib │ │ ├── ok_http.dart │ │ └── src │ │ │ ├── jni │ │ │ └── bindings.dart │ │ │ ├── ok_http_client.dart │ │ │ └── ok_http_web_socket.dart │ └── pubspec.yaml ├── web_socket │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── example │ │ └── web_socket_example.dart │ ├── lib │ │ ├── browser_web_socket.dart │ │ ├── io_web_socket.dart │ │ ├── src │ │ │ ├── browser_web_socket.dart │ │ │ ├── connect_stub.dart │ │ │ ├── fake_web_socket.dart │ │ │ ├── io_web_socket.dart │ │ │ ├── utils.dart │ │ │ └── web_socket.dart │ │ ├── testing.dart │ │ └── web_socket.dart │ ├── mono_pkg.yaml │ ├── pubspec.yaml │ └── test │ │ ├── browser_web_socket_conformance_test.dart │ │ ├── exceptions_test.dart │ │ ├── fake_web_socket_test.dart │ │ ├── io_web_socket_conformance_test.dart │ │ ├── io_web_socket_test.dart │ │ └── websocket_test.dart ├── web_socket_channel │ ├── .gitignore │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── example │ │ └── example.dart │ ├── lib │ │ ├── adapter_web_socket_channel.dart │ │ ├── html.dart │ │ ├── io.dart │ │ ├── src │ │ │ ├── channel.dart │ │ │ ├── exception.dart │ │ │ └── sink_completer.dart │ │ ├── status.dart │ │ └── web_socket_channel.dart │ ├── pubspec.yaml │ └── test │ │ ├── adapter_web_socket_channel_test.dart │ │ ├── echo_server_vm.dart │ │ ├── echo_server_web.dart │ │ ├── html_test.dart │ │ └── io_test.dart └── web_socket_conformance_tests │ ├── .gitattributes │ ├── LICENSE │ ├── README.md │ ├── bin │ └── generate_server_wrappers.dart │ ├── example │ └── client_test.dart │ ├── lib │ ├── src │ │ ├── close_local_server.dart │ │ ├── close_local_server_vm.dart │ │ ├── close_local_server_web.dart │ │ ├── close_local_tests.dart │ │ ├── close_remote_server.dart │ │ ├── close_remote_server_vm.dart │ │ ├── close_remote_server_web.dart │ │ ├── close_remote_tests.dart │ │ ├── connect_uri_tests.dart │ │ ├── continuously_writing_server.dart │ │ ├── continuously_writing_server_vm.dart │ │ ├── continuously_writing_server_web.dart │ │ ├── disconnect_after_upgrade_server.dart │ │ ├── disconnect_after_upgrade_server_vm.dart │ │ ├── disconnect_after_upgrade_server_web.dart │ │ ├── disconnect_after_upgrade_tests.dart │ │ ├── echo_server.dart │ │ ├── echo_server_vm.dart │ │ ├── echo_server_web.dart │ │ ├── no_upgrade_server.dart │ │ ├── no_upgrade_server_vm.dart │ │ ├── no_upgrade_server_web.dart │ │ ├── no_upgrade_tests.dart │ │ ├── payload_transfer_tests.dart │ │ ├── peer_protocol_errors_server.dart │ │ ├── peer_protocol_errors_server_vm.dart │ │ ├── peer_protocol_errors_server_web.dart │ │ ├── peer_protocol_errors_tests.dart │ │ ├── protocol_server.dart │ │ ├── protocol_server_vm.dart │ │ ├── protocol_server_web.dart │ │ └── protocol_tests.dart │ └── web_socket_conformance_tests.dart │ ├── mono_pkg.yaml │ └── pubspec.yaml └── tool └── ci.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | .github/workflows/dart.yml linguist-generated=true 2 | tool/ci.sh linguist-generated=true 3 | pkgs/*/.metadata linguist-generated=true 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2--package-http---i-found-a-bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 2) package:http - I found a bug 3 | about: You found that something which is expected to work, doesn't. The same capability 4 | works when using `dart:io` or `dart:html` directly. 5 | title: '' 6 | labels: package:http, type-bug 7 | assignees: '' 8 | 9 | --- 10 | 11 | Please describe the bug and how to reproduce it. 12 | 13 | Note that if the bug can also be reproduced when going through the interfaces provided by `dart:html` or `dart:io` directly the bug should be filed against the Dart SDK: https://github.com/dart-lang/sdk/issues 14 | 15 | A failure to make an HTTP request is more often a problem with the environment than with the client. 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/3--package-http---i-d-like-a-new-feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 3) package:http - I'd like a new feature 3 | about: You are using package:http and would like a new feature to make it easier 4 | to make http requests. 5 | title: '' 6 | labels: package:http, type-enhancement 7 | assignees: '' 8 | 9 | --- 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/4--package-cronet_http---i-found-a-bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 4) package:cronet_http - I found a bug 3 | about: You found that something which is expected to work, doesn't. 4 | title: '' 5 | labels: package:cronet_http, type-bug 6 | assignees: brianquinlan 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/5--package-cronet_http---i-d-like-a-new-feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 5) package:cronet_http - I'd like a new feature 3 | about: You are using package:cronet_http and would like a new feature to make it easier 4 | to make http requests. 5 | title: '' 6 | labels: package:cronet_http, type-enhancement 7 | assignees: brianquinlan 8 | 9 | --- 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/6--package-cupertino_http---i-found-a-bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 6) package:cupertino_http - I found a bug 3 | about: You found that something which is expected to work, doesn't. 4 | title: '' 5 | labels: package:cupertino_http, type-bug 6 | assignees: brianquinlan 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/7--package-cupertino_http---i-d-like-a-new-feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 7) package:cupertino_http - I'd like a new feature 3 | about: You are using package:cupertino_http and would like a new feature to make it 4 | easier to make http requests. 5 | title: '' 6 | labels: package:cupertino_http, type-enhancement 7 | assignees: brianquinlan 8 | 9 | --- 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/http2.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "package:http2" 3 | about: "Create a bug or file a feature request against package:http2." 4 | labels: "package:http2" 5 | --- -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/http_multi_server.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "package:http_multi_server" 3 | about: "Create a bug or file a feature request against package:http_multi_server." 4 | labels: "package:http_multi_server" 5 | --- -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/http_parser.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "package:http_parser" 3 | about: "Create a bug or file a feature request against package:http_parser." 4 | labels: "package:http_parser" 5 | --- -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/web_socket_channel.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "package:web_socket_channel" 3 | about: "Create a bug or file a feature request against package:web_socket_channel." 4 | labels: "package:web_socket_channel" 5 | --- -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Dependabot configuration file. 2 | # See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates 3 | 4 | version: 2 5 | updates: 6 | - package-ecosystem: github-actions 7 | directory: / 8 | schedule: 9 | interval: monthly 10 | labels: 11 | - autosubmit 12 | groups: 13 | github-actions: 14 | patterns: 15 | - "*" 16 | -------------------------------------------------------------------------------- /.github/workflows/health.yaml: -------------------------------------------------------------------------------- 1 | name: Health 2 | on: 3 | pull_request: 4 | branches: [ master ] 5 | types: [opened, synchronize, reopened, labeled, unlabeled] 6 | 7 | jobs: 8 | health: 9 | uses: dart-lang/ecosystem/.github/workflows/health.yaml@main 10 | with: 11 | sdk: dev 12 | channel: dev 13 | flutter_packages: "pkgs/cronet_http,pkgs/cupertino_http,pkgs/ok_http" 14 | permissions: 15 | pull-requests: write 16 | -------------------------------------------------------------------------------- /.github/workflows/post_summaries.yaml: -------------------------------------------------------------------------------- 1 | name: Comment on the pull request 2 | 3 | on: 4 | # Trigger this workflow after the Health workflow completes. This workflow will have permissions to 5 | # do things like create comments on the PR, even if the original workflow couldn't. 6 | workflow_run: 7 | workflows: 8 | - Health 9 | - Publish 10 | types: 11 | - completed 12 | 13 | jobs: 14 | upload: 15 | uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main 16 | permissions: 17 | pull-requests: write 18 | -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | # A CI configuration to auto-publish pub packages. 2 | 3 | name: Publish 4 | 5 | on: 6 | pull_request: 7 | branches: [ master ] 8 | push: 9 | tags: 10 | - '*-v[0-9]+.[0-9]+.[0-9]+' 11 | - '*-v[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' 12 | 13 | jobs: 14 | publish: 15 | if: ${{ github.repository_owner == 'dart-lang' }} 16 | uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main 17 | with: 18 | write-comments: false 19 | permissions: 20 | id-token: write # Required for authentication using OIDC 21 | pull-requests: write # Required for writing the pull request note 22 | -------------------------------------------------------------------------------- /.github/workflows/pull_request_label.yml: -------------------------------------------------------------------------------- 1 | # This workflow applies labels to pull requests based on the paths that are 2 | # modified in the pull request. 3 | # 4 | # Edit `.github/labeler.yml` to configure labels. For more information, see 5 | # https://github.com/actions/labeler. 6 | 7 | name: Pull Request Labeler 8 | permissions: read-all 9 | 10 | on: 11 | pull_request_target 12 | 13 | jobs: 14 | label: 15 | permissions: 16 | pull-requests: write 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 20 | with: 21 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 22 | sync-labels: true 23 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:dart_flutter_team_lints/analysis_options.yaml 2 | 3 | analyzer: 4 | language: 5 | strict-casts: true 6 | strict-raw-types: true 7 | strict-inference: true 8 | 9 | linter: 10 | rules: 11 | - avoid_bool_literals_in_conditional_expressions 12 | - avoid_classes_with_only_static_members 13 | - avoid_private_typedef_functions 14 | - avoid_returning_this 15 | - avoid_unused_constructor_parameters 16 | - cascade_invocations 17 | - join_return_with_assignment 18 | - missing_whitespace_between_adjacent_strings 19 | - no_adjacent_strings_in_list 20 | - no_runtimeType_toString 21 | - prefer_const_declarations 22 | - prefer_expression_function_bodies 23 | - use_string_buffers 24 | -------------------------------------------------------------------------------- /mono_repo.yaml: -------------------------------------------------------------------------------- 1 | # See https://github.com/google/mono_repo.dart for details on this file 2 | self_validate: analyze_and_format 3 | 4 | github: 5 | cron: "0 0 * * 0" 6 | 7 | merge_stages: 8 | - analyze_and_format 9 | - unit_test 10 | -------------------------------------------------------------------------------- /pkgs/cronet_http/.gitattributes: -------------------------------------------------------------------------------- 1 | # jnigen generated code 2 | lib/src/jni/jni_bindings.dart linguist-generated 3 | -------------------------------------------------------------------------------- /pkgs/cronet_http/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .gradle/ 3 | -------------------------------------------------------------------------------- /pkgs/cronet_http/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 85684f9300908116a78138ea4c6036c35c9a1236 8 | channel: stable 9 | 10 | project_type: plugin 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 17 | base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 18 | - platform: android 19 | create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 20 | base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /pkgs/cronet_http/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | 3 | analyzer: 4 | exclude: 5 | - lib/src/jni/jni_bindings.dart 6 | - lib/src/messages.dart 7 | - pigeons/messages.dart 8 | -------------------------------------------------------------------------------- /pkgs/cronet_http/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .cxx 10 | -------------------------------------------------------------------------------- /pkgs/cronet_http/android/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class io.flutter.plugins.cronet_http.** { *; } 2 | -keep class java.net.URL { *; } 3 | -keep class java.util.concurrent.Executors { *; } 4 | -keep class org.chromium.net.** { *; } 5 | -------------------------------------------------------------------------------- /pkgs/cronet_http/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "8.1.0" apply false 22 | id "org.jetbrains.kotlin.android" version "1.7.21" apply false 23 | } 24 | 25 | include ":app" 26 | 27 | dependencyResolutionManagement { 28 | repositories { 29 | google() 30 | } 31 | } -------------------------------------------------------------------------------- /pkgs/cronet_http/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Web related 36 | lib/generated_plugin_registrant.dart 37 | 38 | # Symbolication related 39 | app.*.symbols 40 | 41 | # Obfuscation related 42 | app.*.map.json 43 | 44 | # Android Studio will place build artifacts here 45 | /android/app/debug 46 | /android/app/profile 47 | /android/app/release 48 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/README.md: -------------------------------------------------------------------------------- 1 | # cronet_http_example 2 | 3 | Demonstrates how to use the cronet_http plugin. 4 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/to/reference-keystore 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/kotlin/io/flutter/cronet_http_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package io.flutter.cronet_http_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cronet_http/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cronet_http/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cronet_http/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cronet_http/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cronet_http/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | rootProject.buildDir = '../build' 2 | subprojects { 3 | project.buildDir = "${rootProject.buildDir}/${project.name}" 4 | } 5 | subprojects { 6 | project.evaluationDependsOn(':app') 7 | } 8 | 9 | tasks.register("clean", Delete) { 10 | delete rootProject.buildDir 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | org.gradle.caching=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip 7 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "8.6.0" apply false 22 | id "org.jetbrains.kotlin.android" version "1.8.10" apply false 23 | } 24 | 25 | include ":app" 26 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/lib/book.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | class Book { 6 | String title; 7 | String description; 8 | Uri imageUrl; 9 | 10 | Book(this.title, this.description, this.imageUrl); 11 | 12 | static List listFromJson(Map json) { 13 | final books = []; 14 | 15 | if (json['items'] case final List items) { 16 | for (final item in items) { 17 | if (item case {'volumeInfo': final Map volumeInfo}) { 18 | if (volumeInfo 19 | case { 20 | 'title': final String title, 21 | 'description': final String description, 22 | 'imageLinks': {'smallThumbnail': final String thumbnail} 23 | }) { 24 | books.add(Book(title, description, Uri.parse(thumbnail))); 25 | } 26 | } 27 | } 28 | } 29 | 30 | return books; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/cronet_http/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cronet_http_example 2 | description: Demonstrates how to use the cronet_http plugin. 3 | 4 | publish_to: 'none' 5 | 6 | environment: 7 | sdk: ^3.4.0 8 | 9 | dependencies: 10 | cronet_http: 11 | path: ../ 12 | cupertino_icons: ^1.0.2 13 | flutter: 14 | sdk: flutter 15 | http: ^1.0.0 16 | http_image_provider: ^1.0.0 17 | provider: ^6.1.1 18 | 19 | dev_dependencies: 20 | dart_flutter_team_lints: ^3.0.0 21 | flutter_test: 22 | sdk: flutter 23 | http_client_conformance_tests: 24 | path: ../../http_client_conformance_tests/ 25 | http_profile: ^0.1.0 26 | integration_test: 27 | sdk: flutter 28 | test: ^1.23.1 29 | 30 | flutter: 31 | uses-material-design: true 32 | 33 | # TODO(brianquinlan): Remove this when a release version of `package:http` 34 | # supports abortable requests. 35 | dependency_overrides: 36 | http: 37 | path: ../../http/ 38 | -------------------------------------------------------------------------------- /pkgs/cronet_http/jnigen.yaml: -------------------------------------------------------------------------------- 1 | # Regenerate bindings with `dart run jnigen --config jnigen.yaml`. 2 | 3 | android_sdk_config: 4 | add_gradle_deps: true 5 | android_example: 'example/' 6 | 7 | output: 8 | dart: 9 | path: 'lib/src/jni/jni_bindings.dart' 10 | structure: single_file 11 | 12 | classes: 13 | - 'io.flutter.plugins.cronet_http.UrlRequestCallbackProxy' 14 | - 'java.net.URL' 15 | - 'java.util.concurrent.Executors' 16 | - 'org.chromium.net.CronetEngine' 17 | - 'org.chromium.net.CronetException' 18 | - 'org.chromium.net.UploadDataProviders' 19 | - 'org.chromium.net.UrlRequest' 20 | - 'org.chromium.net.UrlResponseInfo' 21 | -------------------------------------------------------------------------------- /pkgs/cronet_http/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cronet_http 2 | version: 1.4.0-wip 3 | description: >- 4 | An Android Flutter plugin that provides access to the Cronet HTTP client. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http 6 | 7 | environment: 8 | sdk: ^3.4.0 9 | flutter: '>=3.22.0' 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | http: ^1.2.0 15 | http_profile: ^0.1.0 16 | jni: ^0.12.0 17 | 18 | dev_dependencies: 19 | dart_flutter_team_lints: ^3.0.0 20 | jnigen: ^0.12.0 21 | xml: ^6.1.0 22 | yaml_edit: ^2.0.3 23 | 24 | flutter: 25 | plugin: 26 | platforms: 27 | android: 28 | ffiPlugin: true 29 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/.gitattributes: -------------------------------------------------------------------------------- 1 | # ffigen generated code 2 | lib/src/native_cupertino_bindings.dart linguist-generated 3 | darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m linguist-generated 4 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/DEVELOPMENT.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | ## Architecture 4 | 5 | ![Architecture Diagram](./img/architecture.svg?raw=true) 6 | 7 | `package:cupertino_http` is organized into three components: 8 | 1. [bindings](lib/src/native_cupertino_bindings.dart) generated by 9 | [ffigen](https://pub.dev/packages/ffigen) to relevant 10 | [Foundation framework](https://developer.apple.com/documentation/foundation) 11 | functionality. Configured using [`ffigen.yaml`](ffigen.yaml). 12 | 2. A [native helper library](src/) that fills gaps in the generated bindings. 13 | 3. Dart source that provides a high-level interface to the 14 | [Foundation framework](https://developer.apple.com/documentation/foundation) 15 | [URL Loading System](https://developer.apple.com/documentation/foundation/url_loading_system). 16 | 17 | ## Running the tests 18 | 19 | ```shell 20 | cd example 21 | flutter test integration_test 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .build/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | .swiftpm/ 13 | migrate_working_dir/ 14 | 15 | # IntelliJ related 16 | *.iml 17 | *.ipr 18 | *.iws 19 | .idea/ 20 | 21 | # The .vscode folder contains launch configuration and tasks you configure in 22 | # VS Code which you may wish to be included in version control, so this line 23 | # is commented out by default. 24 | #.vscode/ 25 | 26 | # Flutter/Dart/Pub related 27 | **/doc/api/ 28 | **/ios/Flutter/.last_build_id 29 | .dart_tool/ 30 | .flutter-plugins 31 | .flutter-plugins-dependencies 32 | .packages 33 | .pub-cache/ 34 | .pub/ 35 | /build/ 36 | 37 | # Web related 38 | lib/generated_plugin_registrant.dart 39 | 40 | # Symbolication related 41 | app.*.symbols 42 | 43 | # Obfuscation related 44 | app.*.map.json 45 | 46 | # Android Studio will place build artifacts here 47 | /android/app/debug 48 | /android/app/profile 49 | /android/app/release 50 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/README.md: -------------------------------------------------------------------------------- 1 | # cupertino_http_example 2 | 3 | Demonstrates how to use the cupertino_http plugin. 4 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/integration_test/web_socket_conformance_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:cupertino_http/cupertino_http.dart'; 6 | import 'package:test/test.dart'; 7 | import 'package:web_socket_conformance_tests/web_socket_conformance_tests.dart'; 8 | 9 | void main() { 10 | testAll(CupertinoWebSocket.connect); 11 | 12 | group('defaultSessionConfiguration', () { 13 | testAll( 14 | CupertinoWebSocket.connect, 15 | ); 16 | }); 17 | group('fromSessionConfiguration', () { 18 | final config = URLSessionConfiguration.ephemeralSessionConfiguration(); 19 | testAll((uri, {protocols}) => 20 | CupertinoWebSocket.connect(uri, protocols: protocols, config: config)); 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/integration_test/web_socket_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:cupertino_http/cupertino_http.dart'; 6 | import 'package:objective_c/objective_c.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | void main() { 10 | group('ConnectionException', () { 11 | test('toString', () { 12 | expect( 13 | ConnectionException( 14 | 'failed to connect', 15 | NSError.errorWithDomain_code_userInfo_( 16 | 'NSURLErrorDomain'.toNSString(), -999, null)) 17 | .toString(), 18 | 'CupertinoErrorWebSocketException: failed to connect ' 19 | '[The operation couldn’t be completed. ' 20 | '(NSURLErrorDomain error -999.)]'); 21 | }); 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 13.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @main 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/lib/book.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | class Book { 6 | String title; 7 | String description; 8 | Uri imageUrl; 9 | 10 | Book(this.title, this.description, this.imageUrl); 11 | 12 | static List listFromJson(Map json) { 13 | final books = []; 14 | 15 | if (json['items'] case final List items) { 16 | for (final item in items) { 17 | if (item case {'volumeInfo': final Map volumeInfo}) { 18 | if (volumeInfo 19 | case { 20 | 'title': final String title, 21 | 'description': final String description, 22 | 'imageLinks': {'smallThumbnail': final String thumbnail} 23 | }) { 24 | books.add(Book(title, description, Uri.parse(thumbnail))); 25 | } 26 | } 27 | } 28 | } 29 | 30 | return books; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | 10 | override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { 11 | return true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/cupertino_http/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = cupertino_http_example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.cupertinoHttpExample 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 The Dart project authors. All rights reserved. 15 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.client 10 | 11 | com.apple.security.network.server 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cupertino_http_example 2 | description: Demonstrates how to use the cupertino_http plugin. 3 | 4 | publish_to: 'none' 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ^3.4.0 10 | flutter: '>=3.22.0' 11 | 12 | dependencies: 13 | cupertino_http: 14 | path: ../ 15 | cupertino_icons: ^1.0.2 16 | flutter: 17 | sdk: flutter 18 | http: ^1.0.0 19 | http_image_provider: ^1.0.0 20 | provider: ^6.1.1 21 | 22 | dev_dependencies: 23 | convert: ^3.1.1 24 | crypto: ^3.0.3 25 | dart_flutter_team_lints: ^3.0.0 26 | ffi: ^2.0.1 27 | flutter_test: 28 | sdk: flutter 29 | http_client_conformance_tests: 30 | path: ../../http_client_conformance_tests/ 31 | http_profile: ^0.1.0 32 | integration_test: 33 | sdk: flutter 34 | objective_c: ^7.0.0 35 | test: ^1.21.1 36 | web_socket_conformance_tests: 37 | path: ../../web_socket_conformance_tests/ 38 | 39 | flutter: 40 | uses-material-design: true 41 | 42 | # TODO(brianquinlan): Remove this when a release version of `package:http` 43 | # supports abortable requests. 44 | dependency_overrides: 45 | http: 46 | path: ../../http/ 47 | -------------------------------------------------------------------------------- /pkgs/cupertino_http/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cupertino_http 2 | version: 2.2.1-wip 3 | description: >- 4 | A macOS/iOS Flutter plugin that provides access to the Foundation URL 5 | Loading System. 6 | repository: https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http 7 | 8 | environment: 9 | sdk: ^3.4.0 10 | flutter: '>=3.24.0' # If changed, update test matrix. 11 | 12 | dependencies: 13 | async: ^2.5.0 14 | ffi: ^2.1.0 15 | flutter: 16 | sdk: flutter 17 | http: ^1.2.0 18 | http_profile: ^0.1.0 19 | objective_c: ^7.0.0 20 | web_socket: '>=0.1.5 <2.0.0' 21 | 22 | dev_dependencies: 23 | dart_flutter_team_lints: ^3.0.0 24 | ffigen: ^18.0.0 25 | 26 | flutter: 27 | plugin: 28 | platforms: 29 | ios: 30 | ffiPlugin: true 31 | sharedDarwinSource: true 32 | macos: 33 | ffiPlugin: true 34 | sharedDarwinSource: true 35 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/to/reference-keystore 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/kotlin/com/example/flutter_http_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_http_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | } 9 | settings.ext.flutterSdkPath = flutterSdkPath() 10 | 11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") 12 | 13 | plugins { 14 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false 15 | } 16 | } 17 | 18 | include ":app" 19 | 20 | apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" 21 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 13.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @main 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/lib/book.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | class Book { 6 | String title; 7 | String description; 8 | Uri imageUrl; 9 | 10 | Book(this.title, this.description, this.imageUrl); 11 | 12 | static List listFromJson(Map json) { 13 | final books = []; 14 | 15 | if (json['items'] case final List items) { 16 | for (final item in items) { 17 | if (item case {'volumeInfo': final Map volumeInfo}) { 18 | if (volumeInfo 19 | case { 20 | 'title': final String title, 21 | 'description': final String description, 22 | 'imageLinks': {'smallThumbnail': final String thumbnail} 23 | }) { 24 | books.add(Book(title, description, Uri.parse(thumbnail))); 25 | } 26 | } 27 | } 28 | } 29 | 30 | return books; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/lib/http_client_factory_web.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:fetch_client/fetch_client.dart'; 6 | import 'package:http/http.dart'; 7 | 8 | Client httpClient() => FetchClient(mode: RequestMode.cors); 9 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | jni 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = flutter_http_example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterHttpExample 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | com.apple.security.network.client 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/mono_pkg.yaml: -------------------------------------------------------------------------------- 1 | sdk: 2 | - stable 3 | 4 | stages: 5 | - analyze_and_format: 6 | - analyze: --fatal-infos 7 | - format: 8 | - unit_test: 9 | - test: 10 | os: 11 | - macos 12 | - windows 13 | - test: --platform chrome 14 | - command: flutter test 15 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_http_example 2 | version: 1.0.0 3 | description: Demonstrates how to use package:http in a Flutter app. 4 | 5 | publish_to: 'none' 6 | 7 | environment: 8 | sdk: ^3.0.0 9 | flutter: '>=3.10.0' 10 | 11 | dependencies: 12 | cronet_http: ^1.0.0 13 | cupertino_http: ^2.0.0 14 | cupertino_icons: ^1.0.2 15 | fetch_client: ^1.0.2 16 | flutter: 17 | sdk: flutter 18 | http: ^1.0.0 19 | http_image_provider: ^1.0.0 20 | provider: ^6.0.5 21 | 22 | dev_dependencies: 23 | dart_flutter_team_lints: ^3.0.0 24 | flutter_test: 25 | sdk: flutter 26 | integration_test: 27 | sdk: flutter 28 | test: ^1.21.1 29 | 30 | flutter: 31 | uses-material-design: true 32 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/web/favicon.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /pkgs/flutter_http_example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_http_example", 3 | "short_name": "flutter_http_example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | jni 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/flutter_http_example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /pkgs/flutter_http_example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /pkgs/http/example/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert' as convert; 2 | 3 | import 'package:http/http.dart' as http; 4 | 5 | void main(List arguments) async { 6 | // This example uses the Google Books API to search for books about http. 7 | // https://developers.google.com/books/docs/overview 8 | var url = 9 | Uri.https('www.googleapis.com', '/books/v1/volumes', {'q': '{http}'}); 10 | 11 | // Await the http get response, then decode the json-formatted response. 12 | var response = await http.get(url); 13 | if (response.statusCode == 200) { 14 | var jsonResponse = 15 | convert.jsonDecode(response.body) as Map; 16 | var itemCount = jsonResponse['totalItems']; 17 | print('Number of books about http: $itemCount.'); 18 | } else { 19 | print('Request failed with status: ${response.statusCode}.'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/http/example/retry.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:http/http.dart' as http; 6 | import 'package:http/retry.dart'; 7 | 8 | Future main() async { 9 | final client = RetryClient(http.Client()); 10 | try { 11 | print(await client.read(Uri.http('example.org', ''))); 12 | } finally { 13 | client.close(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pkgs/http/lib/browser_client.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/browser_client.dart' show BrowserClient; 6 | -------------------------------------------------------------------------------- /pkgs/http/lib/io_client.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/io_client.dart' show IOClient; 6 | export 'src/io_streamed_response.dart' show IOStreamedResponse; 7 | -------------------------------------------------------------------------------- /pkgs/http/lib/src/client_stub.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'base_client.dart'; 6 | 7 | /// Implemented in `browser_client.dart` and `io_client.dart`. 8 | BaseClient createClient() => throw UnsupportedError( 9 | 'Cannot create a client without dart:js_interop or dart:io.'); 10 | -------------------------------------------------------------------------------- /pkgs/http/lib/src/exception.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | /// An exception caused by an error in a pkg/http client. 6 | class ClientException implements Exception { 7 | final String message; 8 | 9 | /// The URL of the HTTP request or response that failed. 10 | final Uri? uri; 11 | 12 | ClientException(this.message, [this.uri]); 13 | 14 | @override 15 | String toString() { 16 | if (uri != null) { 17 | return 'ClientException: $message, uri=$uri'; 18 | } else { 19 | return 'ClientException: $message'; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pkgs/http/lib/src/multipart_file_io.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:io'; 6 | 7 | import 'package:http_parser/http_parser.dart'; 8 | 9 | import 'byte_stream.dart'; 10 | import 'multipart_file.dart'; 11 | 12 | Future multipartFileFromPath(String field, String filePath, 13 | {String? filename, MediaType? contentType}) async { 14 | late var segments = Uri.file(filePath).pathSegments; 15 | filename ??= segments.isEmpty ? '' : segments.last; 16 | var file = File(filePath); 17 | var length = await file.length(); 18 | var stream = ByteStream(file.openRead()); 19 | return MultipartFile(field, stream, length, 20 | filename: filename, contentType: contentType); 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/http/lib/src/multipart_file_stub.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:http_parser/http_parser.dart'; 6 | 7 | import 'multipart_file.dart'; 8 | 9 | Future multipartFileFromPath(String field, String filePath, 10 | {String? filename, MediaType? contentType}) => 11 | throw UnsupportedError( 12 | 'MultipartFile is only supported where dart:io is available.'); 13 | -------------------------------------------------------------------------------- /pkgs/http/lib/testing.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | /// This library contains testing classes for the HTTP library. 6 | /// 7 | /// The [MockClient] class is a drop-in replacement for `http.Client` that 8 | /// allows test code to set up a local request handler in order to fake a server 9 | /// that responds to HTTP requests: 10 | /// 11 | /// import 'dart:convert'; 12 | /// import 'package:http/testing.dart'; 13 | /// 14 | /// var client = MockClient((request) async { 15 | /// if (request.url.path != "/data.json") { 16 | /// return Response("", 404); 17 | /// } 18 | /// return Response( 19 | /// json.encode({ 20 | /// 'numbers': [1, 4, 15, 19, 214] 21 | /// }), 22 | /// 200, 23 | /// headers: {'content-type': 'application/json'}); 24 | /// }); 25 | library; 26 | 27 | import 'src/mock_client.dart'; 28 | 29 | export 'src/mock_client.dart'; 30 | -------------------------------------------------------------------------------- /pkgs/http/mono_pkg.yaml: -------------------------------------------------------------------------------- 1 | sdk: 2 | - pubspec 3 | - dev 4 | 5 | stages: 6 | - analyze_and_format: 7 | - analyze: --fatal-infos 8 | - format: 9 | sdk: 10 | - dev 11 | - unit_test: 12 | - test: --test-randomize-ordering-seed=random --platform vm 13 | os: 14 | - linux 15 | - test: --test-randomize-ordering-seed=random --platform chrome 16 | os: 17 | - linux 18 | # Firefox needs an X server to run. 19 | - command: xvfb-run -s "-screen 0 1024x768x24" 20 | dart test --test-randomize-ordering-seed=random --platform firefox 21 | os: 22 | - linux 23 | - command: dart run --define=no_default_http_client=true test/no_default_http_client_test.dart 24 | os: 25 | - linux 26 | - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm 27 | sdk: dev 28 | -------------------------------------------------------------------------------- /pkgs/http/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: http 2 | version: 1.5.0-beta.2 3 | description: A composable, multi-platform, Future-based API for HTTP requests. 4 | repository: https://github.com/dart-lang/http/tree/master/pkgs/http 5 | 6 | topics: 7 | - http 8 | - network 9 | - protocols 10 | 11 | environment: 12 | sdk: ^3.4.0 13 | 14 | dependencies: 15 | async: ^2.5.0 16 | http_parser: ^4.0.0 17 | meta: ^1.3.0 18 | web: ">=0.5.0 <2.0.0" 19 | 20 | dev_dependencies: 21 | dart_flutter_team_lints: ^3.0.0 22 | fake_async: ^1.2.0 23 | http_client_conformance_tests: 24 | path: ../http_client_conformance_tests/ 25 | shelf: ^1.1.0 26 | stream_channel: ^2.1.1 27 | test: ^1.21.2 28 | -------------------------------------------------------------------------------- /pkgs/http/test/html/client_conformance_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('browser') 6 | library; 7 | 8 | import 'package:http/browser_client.dart'; 9 | import 'package:http_client_conformance_tests/http_client_conformance_tests.dart'; 10 | import 'package:test/test.dart'; 11 | 12 | void main() { 13 | testAll( 14 | BrowserClient.new, 15 | redirectAlwaysAllowed: true, 16 | canStreamRequestBody: false, 17 | canStreamResponseBody: true, 18 | canWorkInIsolates: false, 19 | supportsMultipartRequest: false, 20 | supportsAbort: true, 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /pkgs/http/test/html/utils.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:web/web.dart' show window; 6 | 7 | export '../utils.dart'; 8 | 9 | /// The test server's echo URL. 10 | Uri get echoUrl => 11 | Uri.parse('${window.location.protocol}//${window.location.host}/echo'); 12 | -------------------------------------------------------------------------------- /pkgs/http/test/io/client_conformance_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('vm') 6 | library; 7 | 8 | import 'package:http/io_client.dart'; 9 | import 'package:http_client_conformance_tests/http_client_conformance_tests.dart'; 10 | import 'package:test/test.dart'; 11 | 12 | void main() { 13 | testAll( 14 | IOClient.new, preservesMethodCase: false, // https://dartbug.com/54187 15 | canReceiveSetCookieHeaders: true, 16 | canSendCookieHeaders: true, 17 | correctlyHandlesNullHeaderValues: 18 | false, // https://github.com/dart-lang/sdk/issues/56636 19 | supportsAbort: true, 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/http/test/no_default_http_client_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:http/http.dart' as http; 6 | import 'package:test/test.dart'; 7 | 8 | /// Tests that no [http.Client] is provided by default when run with 9 | /// `--define=no_default_http_client=true`. 10 | void main() { 11 | test('Client()', () { 12 | if (const bool.fromEnvironment('no_default_http_client')) { 13 | expect(http.Client.new, throwsA(isA())); 14 | } else { 15 | expect(http.Client(), isA()); 16 | } 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /pkgs/http2/.gitignore: -------------------------------------------------------------------------------- 1 | # Don’t commit the following directories created by pub. 2 | .dart_tool 3 | .packages 4 | pubspec.lock 5 | -------------------------------------------------------------------------------- /pkgs/http2/.test_config: -------------------------------------------------------------------------------- 1 | { 2 | "test_package": { 3 | "platforms" : ["vm"] 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /pkgs/http2/AUTHORS: -------------------------------------------------------------------------------- 1 | # Below is a list of people and organizations that have contributed 2 | # to the project. Names should be added to the list like so: 3 | # 4 | # Name/Organization 5 | 6 | Google Inc. <*@google.com> 7 | 8 | Alexandre Ardhuin 9 | -------------------------------------------------------------------------------- /pkgs/http2/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # https://dart.dev/tools/analysis#the-analysis-options-file 2 | include: package:dart_flutter_team_lints/analysis_options.yaml 3 | 4 | analyzer: 5 | language: 6 | strict-casts: true 7 | errors: 8 | # Disabled as there are several dozen violations. 9 | constant_identifier_names: ignore 10 | -------------------------------------------------------------------------------- /pkgs/http2/dart_test.yaml: -------------------------------------------------------------------------------- 1 | tags: 2 | flaky: # Tests that should be run as a separate job on Travis 3 | -------------------------------------------------------------------------------- /pkgs/http2/lib/src/flowcontrol/window.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | class Window { 6 | static const int MAX_WINDOW_SIZE = (1 << 31) - 1; 7 | 8 | /// The size available in this window. 9 | /// 10 | /// The default flow control window for the entire connection and for new 11 | /// streams is 65535). 12 | /// 13 | /// NOTE: This value can potentially become negative. 14 | int _size; 15 | 16 | Window({int initialSize = (1 << 16) - 1}) : _size = initialSize; 17 | 18 | /// The current size of the flow control window. 19 | int get size => _size; 20 | 21 | void modify(int difference) { 22 | _size += difference; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pkgs/http2/lib/src/frames/frame_utils.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | part of 'frames.dart'; 6 | 7 | bool _isFlagSet(int value, int flag) => value & flag == flag; 8 | -------------------------------------------------------------------------------- /pkgs/http2/lib/src/frames/frames.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | import 'dart:math' show max; 7 | import 'dart:typed_data'; 8 | 9 | import '../async_utils/async_utils.dart'; 10 | import '../byte_utils.dart'; 11 | import '../hpack/hpack.dart'; 12 | import '../settings/settings.dart'; 13 | import '../sync_errors.dart'; 14 | 15 | part 'frame_reader.dart'; 16 | part 'frame_types.dart'; 17 | part 'frame_utils.dart'; 18 | part 'frame_writer.dart'; 19 | -------------------------------------------------------------------------------- /pkgs/http2/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: http2 2 | version: 3.0.0 3 | description: A HTTP/2 implementation in Dart. 4 | repository: https://github.com/dart-lang/http/tree/master/pkgs/http2 5 | 6 | topics: 7 | - http 8 | - network 9 | - protocols 10 | 11 | environment: 12 | sdk: ^3.7.0 13 | 14 | dev_dependencies: 15 | build_runner: ^2.4.15 16 | dart_flutter_team_lints: ^3.5.1 17 | mockito: ^5.4.5 18 | test: ^1.25.15 19 | -------------------------------------------------------------------------------- /pkgs/http2/test/src/error_matchers.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:http2/src/sync_errors.dart'; 6 | import 'package:test/test.dart'; 7 | 8 | const Matcher isProtocolException = TypeMatcher(); 9 | const Matcher isFrameSizeException = TypeMatcher(); 10 | const Matcher isTerminatedException = TypeMatcher(); 11 | const Matcher isFlowControlException = TypeMatcher(); 12 | -------------------------------------------------------------------------------- /pkgs/http2/test/src/flowcontrol/mocks.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:http2/src/flowcontrol/connection_queues.dart'; 6 | import 'package:http2/src/flowcontrol/stream_queues.dart'; 7 | import 'package:http2/src/flowcontrol/window_handler.dart'; 8 | import 'package:http2/src/frames/frames.dart'; 9 | import 'package:mockito/annotations.dart'; 10 | 11 | @GenerateMocks( 12 | [FrameWriter, IncomingWindowHandler, OutgoingStreamWindowHandler], 13 | customMocks: [ 14 | MockSpec( 15 | fallbackGenerators: { 16 | #ensureNotTerminatedSync: ensureNotTerminatedSyncFallback, 17 | }, 18 | ), 19 | MockSpec( 20 | fallbackGenerators: { 21 | #ensureNotTerminatedSync: ensureNotTerminatedSyncFallback, 22 | }, 23 | ), 24 | ], 25 | ) 26 | T ensureNotTerminatedSyncFallback(T Function()? f) => 27 | throw UnimplementedError( 28 | 'Method cannot be stubbed; requires fallback values for return', 29 | ); 30 | -------------------------------------------------------------------------------- /pkgs/http2/test/src/frames/frame_writer_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | 7 | import 'package:http2/src/frames/frames.dart'; 8 | import 'package:http2/src/hpack/hpack.dart'; 9 | import 'package:http2/src/settings/settings.dart'; 10 | import 'package:test/test.dart'; 11 | 12 | void main() { 13 | group('frames', () { 14 | group('frame-writer', () { 15 | test('connection-error', () { 16 | var settings = ActiveSettings(); 17 | var context = HPackContext(); 18 | var controller = StreamController>(); 19 | var writer = FrameWriter(context.encoder, controller, settings); 20 | 21 | writer.doneFuture.then( 22 | expectAsync1((_) { 23 | // We expect that the writer is done at this point. 24 | }), 25 | ); 26 | 27 | // We cancel here the reading part (simulates a dying socket). 28 | controller.stream.listen((_) {}).cancel(); 29 | }); 30 | }); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/.gitattributes: -------------------------------------------------------------------------------- 1 | lib/src/*_server_vm.dart linguist-generated=true 2 | lib/src/*_server_web.dart linguist-generated=true 3 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/example/client_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:http/http.dart'; 6 | import 'package:http_client_conformance_tests/http_client_conformance_tests.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | class MyHttpClient extends BaseClient { 10 | @override 11 | Future send(BaseRequest request) async { 12 | // Your implementation here. 13 | throw UnsupportedError('implement this method'); 14 | } 15 | } 16 | 17 | void main() { 18 | group('client conformance tests', () { 19 | testAll(MyHttpClient.new); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/abort_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'abort_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/abort_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri( 10 | Uri( 11 | scheme: 'package', 12 | path: 'http_client_conformance_tests/src/abort_server.dart', 13 | ), 14 | ); 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'compressed_response_body_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 12 | 'http_client_conformance_tests/src/compressed_response_body_server.dart')); 13 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/dummy_isolate.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | 7 | // ignore: avoid_classes_with_only_static_members 8 | /// An Isolate implementation for the web that throws when used. 9 | abstract class Isolate { 10 | static Future run(FutureOr Function() computation, 11 | {String? debugName}) => 12 | throw ArgumentError.value('true', 'canWorkInIsolates', 13 | 'isolate tests are not supported on the web'); 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/multipart_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'multipart_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/multipart_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/multipart_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/multiple_clients_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'multiple_clients_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/multiple_clients_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/multiple_clients_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/redirect_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'redirect_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/redirect_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/redirect_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_body_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'request_body_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_body_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/request_body_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_body_streamed_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'request_body_streamed_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_body_streamed_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 12 | 'http_client_conformance_tests/src/request_body_streamed_server.dart')); 13 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_cookies_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'request_cookies_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_cookies_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/request_cookies_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_headers_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'request_headers_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_headers_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/request_headers_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_methods_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'request_methods_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/request_methods_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/request_methods_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_body_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'response_body_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_body_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/response_body_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_body_streamed_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'response_body_streamed_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_body_streamed_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 12 | 'http_client_conformance_tests/src/response_body_streamed_server.dart')); 13 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_cookies_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'response_cookies_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_cookies_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/response_cookies_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_headers_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'response_headers_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_headers_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/response_headers_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_status_line_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'response_status_line_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/response_status_line_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 12 | 'http_client_conformance_tests/src/response_status_line_server.dart')); 13 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/server_errors_server.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | import 'dart:io'; 7 | 8 | import 'package:stream_channel/stream_channel.dart'; 9 | 10 | /// Starts an HTTP server that disconnects before sending it's headers. 11 | /// 12 | /// Channel protocol: 13 | /// On Startup: 14 | /// - send port 15 | /// When Receive Anything: 16 | /// - exit 17 | void hybridMain(StreamChannel channel) async { 18 | late HttpServer server; 19 | 20 | server = (await HttpServer.bind('localhost', 0)) 21 | ..listen((request) async { 22 | await request.drain(); 23 | final socket = await request.response.detachSocket(writeHeaders: false); 24 | socket.destroy(); 25 | }); 26 | 27 | channel.sink.add(server.port); 28 | await channel 29 | .stream.first; // Any writes indicates that the server should exit. 30 | unawaited(server.close()); 31 | } 32 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/server_errors_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'server_errors_server.dart'; 6 | 7 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 8 | 9 | /// Starts the redirect test HTTP server in the same process. 10 | Future> startServer() async { 11 | final controller = StreamChannelController(sync: true); 12 | hybridMain(controller.foreign); 13 | return controller.local; 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/server_errors_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | export 'server_queue_helpers.dart' show StreamQueueOfNullableObjectExtension; 7 | 8 | /// Starts the redirect test HTTP server out-of-process. 9 | Future> startServer() async => spawnHybridUri(Uri( 10 | scheme: 'package', 11 | path: 'http_client_conformance_tests/src/server_errors_server.dart')); 12 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/lib/src/server_queue_helpers.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:async/async.dart'; 6 | 7 | extension StreamQueueOfNullableObjectExtension on StreamQueue { 8 | /// When run under dart2wasm, JSON numbers are always returned as [double]. 9 | Future get nextAsInt async => ((await next) as num).toInt(); 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/mono_pkg.yaml: -------------------------------------------------------------------------------- 1 | sdk: 2 | - pubspec 3 | - dev 4 | 5 | stages: 6 | - analyze_and_format: 7 | - analyze: --fatal-infos 8 | - format: 9 | sdk: 10 | - dev 11 | -------------------------------------------------------------------------------- /pkgs/http_client_conformance_tests/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: http_client_conformance_tests 2 | description: >- 3 | A library that tests whether implementations of package:http's `Client` class 4 | behave as expected. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/http_client_conformance_tests 6 | publish_to: none 7 | 8 | environment: 9 | sdk: ^3.4.0 10 | 11 | dependencies: 12 | async: ^2.8.2 13 | dart_style: ">=2.3.7 <4.0.0" 14 | http: ^1.2.0 15 | stream_channel: ^2.1.1 16 | test: ^1.21.2 17 | 18 | # TODO(brianquinlan): Remove dependency_overrides when package:http 1.5.0 is released. 19 | dependency_overrides: 20 | http: 21 | path: ../http 22 | 23 | dev_dependencies: 24 | dart_flutter_team_lints: ^3.0.0 25 | -------------------------------------------------------------------------------- /pkgs/http_multi_server/.gitignore: -------------------------------------------------------------------------------- 1 | # Don’t commit the following directories created by pub. 2 | .buildlog 3 | .dart_tool/ 4 | .packages 5 | build/ 6 | 7 | # Or the files created by dart2js. 8 | *.dart.js 9 | *.js_ 10 | *.js.deps 11 | *.js.map 12 | 13 | # Include when developing application packages. 14 | pubspec.lock 15 | -------------------------------------------------------------------------------- /pkgs/http_multi_server/.test_config: -------------------------------------------------------------------------------- 1 | { 2 | "test_package": { 3 | "platforms": ["vm"] 4 | } 5 | } -------------------------------------------------------------------------------- /pkgs/http_multi_server/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # https://dart.dev/tools/analysis#the-analysis-options-file 2 | include: package:dart_flutter_team_lints/analysis_options.yaml 3 | 4 | analyzer: 5 | language: 6 | strict-casts: true 7 | 8 | linter: 9 | rules: 10 | - avoid_bool_literals_in_conditional_expressions 11 | - avoid_classes_with_only_static_members 12 | - avoid_private_typedef_functions 13 | - avoid_redundant_argument_values 14 | - avoid_returning_this 15 | - avoid_unused_constructor_parameters 16 | - cancel_subscriptions 17 | - cascade_invocations 18 | - join_return_with_assignment 19 | - literal_only_boolean_expressions 20 | - no_adjacent_strings_in_list 21 | - no_runtimeType_toString 22 | - prefer_const_declarations 23 | - prefer_expression_function_bodies 24 | - prefer_final_locals 25 | - use_string_buffers 26 | -------------------------------------------------------------------------------- /pkgs/http_multi_server/example/main.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:http_multi_server/http_multi_server.dart'; 6 | import 'package:shelf/shelf.dart' as shelf; 7 | import 'package:shelf/shelf_io.dart' as shelf_io; 8 | 9 | void main() async { 10 | // Both http://127.0.0.1:8080 and http://[::1]:8080 will be bound to the same 11 | // server. 12 | final server = await HttpMultiServer.loopback(8080); 13 | shelf_io.serveRequests( 14 | server, 15 | (request) => shelf.Response.ok('Hello, world!'), 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /pkgs/http_multi_server/lib/src/utils.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:io'; 6 | 7 | /// Returns whether this computer supports binding to IPv6 addresses. 8 | final Future supportsIPv6 = () async { 9 | try { 10 | final socket = await ServerSocket.bind(InternetAddress.loopbackIPv6, 0); 11 | await socket.close(); 12 | return true; 13 | } on SocketException catch (_) { 14 | return false; 15 | } 16 | }(); 17 | 18 | /// Returns whether this computer supports binding to IPv4 addresses. 19 | final Future supportsIPv4 = () async { 20 | try { 21 | final socket = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0); 22 | await socket.close(); 23 | return true; 24 | } on SocketException catch (_) { 25 | return false; 26 | } 27 | }(); 28 | -------------------------------------------------------------------------------- /pkgs/http_multi_server/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: http_multi_server 2 | version: 3.2.2 3 | description: >- 4 | A dart:io HttpServer wrapper that handles requests from multiple servers. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/http_multi_server 6 | 7 | environment: 8 | sdk: ^3.2.0 9 | 10 | dependencies: 11 | async: ^2.5.0 12 | 13 | dev_dependencies: 14 | dart_flutter_team_lints: ^3.0.0 15 | http: ^1.0.0 16 | shelf: ^1.4.0 17 | test: ^1.16.6 18 | -------------------------------------------------------------------------------- /pkgs/http_parser/.gitignore: -------------------------------------------------------------------------------- 1 | # Don’t commit the following directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | pubspec.lock 5 | -------------------------------------------------------------------------------- /pkgs/http_parser/README.md: -------------------------------------------------------------------------------- 1 | [![Pub Package](https://img.shields.io/pub/v/http_parser.svg)](https://pub.dartlang.org/packages/http_parser) 2 | [![package publisher](https://img.shields.io/pub/publisher/http_parser.svg)](https://pub.dev/packages/http_parser/publisher) 3 | 4 | `http_parser` is a platform-independent package for parsing and serializing 5 | various HTTP-related formats. It's designed to be usable on both the browser and 6 | the server, and thus avoids referencing any types from `dart:io` or `dart:html`. 7 | 8 | ## Features 9 | 10 | * Support for parsing and formatting dates according to [HTTP/1.1][2616], the 11 | HTTP/1.1 standard. 12 | 13 | * A `MediaType` class that represents an HTTP media type, as used in `Accept` 14 | and `Content-Type` headers. This class supports both parsing and formatting 15 | media types according to [HTTP/1.1][2616]. 16 | 17 | * A `WebSocketChannel` class that provides a `StreamChannel` interface for both 18 | the client and server sides of the [WebSocket protocol][6455] independently of 19 | any specific server implementation. 20 | 21 | [2616]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html 22 | [6455]: https://tools.ietf.org/html/rfc6455 23 | -------------------------------------------------------------------------------- /pkgs/http_parser/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # https://dart.dev/tools/analysis#the-analysis-options-file 2 | include: package:dart_flutter_team_lints/analysis_options.yaml 3 | 4 | analyzer: 5 | language: 6 | strict-casts: true 7 | strict-inference: true 8 | strict-raw-types: true 9 | 10 | linter: 11 | rules: 12 | - avoid_bool_literals_in_conditional_expressions 13 | - avoid_classes_with_only_static_members 14 | - avoid_private_typedef_functions 15 | - avoid_redundant_argument_values 16 | - avoid_returning_this 17 | - avoid_unused_constructor_parameters 18 | - avoid_void_async 19 | - cancel_subscriptions 20 | - join_return_with_assignment 21 | - literal_only_boolean_expressions 22 | - missing_whitespace_between_adjacent_strings 23 | - no_adjacent_strings_in_list 24 | - no_runtimeType_toString 25 | - prefer_const_declarations 26 | - prefer_expression_function_bodies 27 | - prefer_final_locals 28 | - unnecessary_await_in_return 29 | - unnecessary_breaks 30 | - use_if_null_to_convert_nulls_to_bools 31 | - use_raw_strings 32 | - use_string_buffers 33 | -------------------------------------------------------------------------------- /pkgs/http_parser/example/example.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:http_parser/http_parser.dart'; 6 | 7 | void main() { 8 | final date = DateTime.utc(2014, 9, 9, 9, 9, 9); 9 | print(date); // 2014-09-09 09:09:09.000Z 10 | 11 | final httpDateFormatted = formatHttpDate(date); 12 | print(httpDateFormatted); // Tue, 09 Sep 2014 09:09:09 GMT 13 | 14 | final nowParsed = parseHttpDate(httpDateFormatted); 15 | print(nowParsed); // 2014-09-09 09:09:09.000Z 16 | } 17 | -------------------------------------------------------------------------------- /pkgs/http_parser/lib/http_parser.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/authentication_challenge.dart'; 6 | export 'src/case_insensitive_map.dart'; 7 | export 'src/chunked_coding.dart'; 8 | export 'src/http_date.dart'; 9 | export 'src/media_type.dart'; 10 | -------------------------------------------------------------------------------- /pkgs/http_parser/lib/src/case_insensitive_map.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:collection/collection.dart'; 6 | 7 | /// A map from case-insensitive strings to values. 8 | /// 9 | /// Much of HTTP is case-insensitive, so this is useful to have pre-defined. 10 | class CaseInsensitiveMap extends CanonicalizedMap { 11 | /// Creates an empty case-insensitive map. 12 | CaseInsensitiveMap() : super(_canonicalizer); 13 | 14 | /// Creates a case-insensitive map that is initialized with the key/value 15 | /// pairs of [other]. 16 | CaseInsensitiveMap.from(Map other) 17 | : super.from(other, _canonicalizer); 18 | 19 | /// Creates a case-insensitive map that is initialized with the key/value 20 | /// pairs of [entries]. 21 | CaseInsensitiveMap.fromEntries(Iterable> entries) 22 | : super.fromEntries(entries, _canonicalizer); 23 | 24 | static String _canonicalizer(String key) => key.toLowerCase(); 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/http_parser/lib/src/chunked_coding/charcodes.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | /// "Line feed" control character. 6 | const int $lf = 0x0a; 7 | 8 | /// "Carriage return" control character. 9 | const int $cr = 0x0d; 10 | 11 | /// Character `0`. 12 | const int $0 = 0x30; 13 | 14 | /// Character `1`. 15 | const int $1 = 0x31; 16 | 17 | /// Character `3`. 18 | const int $3 = 0x33; 19 | 20 | /// Character `4`. 21 | const int $4 = 0x34; 22 | 23 | /// Character `7`. 24 | const int $7 = 0x37; 25 | 26 | /// Character `A`. 27 | const int $A = 0x41; 28 | 29 | /// Character `q`. 30 | const int $q = 0x71; 31 | 32 | /// Character `a`. 33 | const int $a = 0x61; 34 | 35 | /// Character `f`. 36 | const int $f = 0x66; 37 | -------------------------------------------------------------------------------- /pkgs/http_parser/lib/src/utils.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:source_span/source_span.dart'; 6 | 7 | /// Runs [body] and wraps any format exceptions it produces. 8 | /// 9 | /// [name] should describe the type of thing being parsed, and [value] should be 10 | /// its actual value. 11 | T wrapFormatException(String name, String value, T Function() body) { 12 | try { 13 | return body(); 14 | } on SourceSpanFormatException catch (error) { 15 | throw SourceSpanFormatException( 16 | 'Invalid $name: ${error.message}', error.span, error.source); 17 | } on FormatException catch (error) { 18 | throw FormatException( 19 | 'Invalid $name "$value": ${error.message}', error.source, error.offset); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/http_parser/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: http_parser 2 | version: 4.1.2 3 | description: >- 4 | A platform-independent package for parsing and serializing HTTP formats. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/http_parser 6 | 7 | environment: 8 | sdk: ^3.4.0 9 | 10 | dependencies: 11 | collection: ^1.19.0 12 | source_span: ^1.8.0 13 | string_scanner: ^1.1.0 14 | typed_data: ^1.3.0 15 | 16 | dev_dependencies: 17 | dart_flutter_team_lints: ^3.0.0 18 | test: ^1.16.6 19 | -------------------------------------------------------------------------------- /pkgs/http_parser/test/example_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:io'; 6 | 7 | import 'package:test/test.dart'; 8 | 9 | void main() { 10 | test('validate example', () { 11 | final result = Process.runSync( 12 | Platform.executable, 13 | [ 14 | '--enable-experiment=non-nullable', 15 | 'example/example.dart', 16 | ], 17 | ); 18 | 19 | expect(result.exitCode, 0); 20 | expect(result.stdout, ''' 21 | 2014-09-09 09:09:09.000Z 22 | Tue, 09 Sep 2014 09:09:09 GMT 23 | 2014-09-09 09:09:09.000Z 24 | '''); 25 | }, testOn: 'vm'); 26 | } 27 | -------------------------------------------------------------------------------- /pkgs/http_profile/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.1-wip 2 | 3 | * Fixed unintended HTML tags in doc comments. 4 | 5 | ## 0.1.0 6 | 7 | * Initial **experimental** release. 8 | -------------------------------------------------------------------------------- /pkgs/http_profile/lib/http_profile.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/http_profile.dart'; 6 | -------------------------------------------------------------------------------- /pkgs/http_profile/lib/src/http_profile.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | import 'dart:collection' show UnmodifiableListView, UnmodifiableMapView; 7 | import 'dart:developer' show Service, addHttpClientProfilingData; 8 | import 'dart:io' show HttpClient, HttpClientResponseCompressionState; 9 | import 'dart:isolate' show Isolate; 10 | 11 | import 'utils.dart'; 12 | 13 | part 'http_client_request_profile.dart'; 14 | part 'http_profile_request_data.dart'; 15 | part 'http_profile_response_data.dart'; 16 | -------------------------------------------------------------------------------- /pkgs/http_profile/mono_pkg.yaml: -------------------------------------------------------------------------------- 1 | sdk: 2 | - pubspec 3 | - dev 4 | 5 | stages: 6 | - analyze_and_format: 7 | - analyze: --fatal-infos 8 | - format: 9 | sdk: 10 | - dev 11 | - unit_test: 12 | - test: --platform vm 13 | os: 14 | - linux 15 | -------------------------------------------------------------------------------- /pkgs/http_profile/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: http_profile 2 | description: >- 3 | A library used by HTTP client authors to integrate with the DevTools Network 4 | View. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/http_profile 6 | version: 0.1.1-wip 7 | 8 | environment: 9 | sdk: ^3.4.0 10 | 11 | dev_dependencies: 12 | dart_flutter_team_lints: ^3.0.0 13 | test: ^1.24.9 14 | -------------------------------------------------------------------------------- /pkgs/ok_http/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | build/ 30 | -------------------------------------------------------------------------------- /pkgs/ok_http/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3" 8 | channel: "stable" 9 | 10 | project_type: plugin_ffi 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 17 | base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 18 | - platform: android 19 | create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 20 | base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /pkgs/ok_http/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .cxx 10 | -------------------------------------------------------------------------------- /pkgs/ok_http/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ok_http' 2 | -------------------------------------------------------------------------------- /pkgs/ok_http/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Symbolication related 35 | app.*.symbols 36 | 37 | # Obfuscation related 38 | app.*.map.json 39 | 40 | # Android Studio will place build artifacts here 41 | /android/app/debug 42 | /android/app/profile 43 | /android/app/release 44 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/README.md: -------------------------------------------------------------------------------- 1 | # ok_http_example 2 | 3 | Demonstrates how to use the ok_http plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/to/reference-keystore 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/kotlin/com/example/ok_http_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.ok_http_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() 6 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/ok_http/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/ok_http/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/ok_http/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/ok_http/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/ok_http/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = "../build" 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(":app") 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip 6 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "8.2.1" apply false 22 | id "org.jetbrains.kotlin.android" version "1.9.23" apply false 23 | } 24 | 25 | include ":app" 26 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/integration_test/web_socket_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:ok_http/ok_http.dart'; 6 | import 'package:web_socket_conformance_tests/web_socket_conformance_tests.dart'; 7 | 8 | void main() { 9 | testAll(OkHttpWebSocket.connect); 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/lib/book.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | class Book { 6 | String title; 7 | String description; 8 | Uri imageUrl; 9 | 10 | Book(this.title, this.description, this.imageUrl); 11 | 12 | static List listFromJson(Map json) { 13 | final books = []; 14 | 15 | if (json['items'] case final List items) { 16 | for (final item in items) { 17 | if (item case {'volumeInfo': final Map volumeInfo}) { 18 | if (volumeInfo 19 | case { 20 | 'title': final String title, 21 | 'description': final String description, 22 | 'imageLinks': {'smallThumbnail': final String thumbnail} 23 | }) { 24 | books.add(Book(title, description, Uri.parse(thumbnail))); 25 | } 26 | } 27 | } 28 | } 29 | 30 | return books; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: ok_http_example 2 | description: "Demonstrates how to use the ok_http plugin." 3 | 4 | publish_to: "none" 5 | version: 1.0.0+1 6 | 7 | environment: 8 | sdk: ">=3.4.1 <4.0.0" 9 | 10 | dependencies: 11 | cupertino_icons: ^1.0.6 12 | flutter: 13 | sdk: flutter 14 | http: ^1.0.0 15 | http_image_provider: ^1.0.0 16 | ok_http: 17 | path: ../ 18 | provider: ^6.1.1 19 | web_socket: '>=0.1.5 <2.0.0' 20 | 21 | dev_dependencies: 22 | dart_flutter_team_lints: ^3.0.0 23 | flutter_test: 24 | sdk: flutter 25 | http_client_conformance_tests: 26 | path: ../../http_client_conformance_tests/ 27 | http_profile: ^0.1.0 28 | integration_test: 29 | sdk: flutter 30 | test: ^1.23.1 31 | web_socket_conformance_tests: 32 | path: ../../web_socket_conformance_tests/ 33 | 34 | flutter: 35 | uses-material-design: true 36 | assets: 37 | - test_certs/ # Used in integration tests. 38 | 39 | # TODO(brianquinlan): Remove this when a release version of `package:http` 40 | # supports abortable requests. 41 | dependency_overrides: 42 | http: 43 | path: ../../http/ 44 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/test_certs/README.md: -------------------------------------------------------------------------------- 1 | # Certificates 2 | 3 | The certificates and private keys used for `package:ok_http` TLS testing. 4 | 5 | TODO: generate these files using a script. 6 | -------------------------------------------------------------------------------- /pkgs/ok_http/example/test_certs/server_chain.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/ok_http/example/test_certs/server_chain.p12 -------------------------------------------------------------------------------- /pkgs/ok_http/example/test_certs/server_key.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/ok_http/example/test_certs/server_key.p12 -------------------------------------------------------------------------------- /pkgs/ok_http/example/test_certs/test-combined.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dart-lang/http/984cc43a324a8cb6d759c1065b72328cace36373/pkgs/ok_http/example/test_certs/test-combined.p12 -------------------------------------------------------------------------------- /pkgs/ok_http/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: ok_http 2 | version: 0.1.1-wip 3 | description: >- 4 | An Android Flutter plugin that provides access to the OkHttp HTTP client. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/ok_http 6 | 7 | environment: 8 | sdk: ^3.4.0 9 | flutter: ">=3.22.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | http: ^1.2.1 15 | http_profile: ^0.1.0 16 | jni: ^0.14.0 17 | plugin_platform_interface: ^2.0.2 18 | web_socket: '>=0.1.5 <2.0.0' 19 | 20 | dev_dependencies: 21 | dart_flutter_team_lints: ^3.0.0 22 | jnigen: ^0.14.0 23 | 24 | flutter: 25 | plugin: 26 | platforms: 27 | android: 28 | ffiPlugin: true 29 | -------------------------------------------------------------------------------- /pkgs/web_socket/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.1 2 | 3 | - Fix a bug where `WebSocketException`/`WebSocketConnectionClosed` did not 4 | have a useful string representation. 5 | 6 | ## 1.0.0 7 | 8 | - First non-experimental release; no semantic changes from version `0.1.6`. 9 | 10 | ## 0.1.6 11 | 12 | - Allow `web: '>=0.5.0 <2.0.0'`. 13 | 14 | ## 0.1.5 15 | 16 | - Allow `1000` as a close code. 17 | 18 | ## 0.1.4 19 | 20 | - Add a `fakes` function that returns a pair of `WebSocket`s useful in 21 | testing. 22 | 23 | ## 0.1.3 24 | 25 | - Bring the behavior in line with the documentation by throwing 26 | `WebSocketConnectionClosed` rather `StateError` when attempting to send 27 | data to or close an already closed `WebSocket`. 28 | 29 | ## 0.1.2 30 | 31 | - Fix a `StateError` in `IOWebSocket` when data is received from the peer 32 | after the connection has been closed locally. 33 | 34 | ## 0.1.1 35 | 36 | - Add the ability to create a `package:web_socket` `WebSocket` given a 37 | `dart:io` `WebSocket`. 38 | 39 | ## 0.1.0 40 | 41 | - Basic functionality in place. 42 | -------------------------------------------------------------------------------- /pkgs/web_socket/lib/browser_web_socket.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/browser_web_socket.dart' show BrowserWebSocket; 6 | -------------------------------------------------------------------------------- /pkgs/web_socket/lib/io_web_socket.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/io_web_socket.dart' show IOWebSocket; 6 | -------------------------------------------------------------------------------- /pkgs/web_socket/lib/src/connect_stub.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import '../web_socket.dart'; 6 | 7 | Future connect(Uri url, {Iterable? protocols}) { 8 | throw UnsupportedError('Cannot connect without dart:js_interop or dart:io.'); 9 | } 10 | -------------------------------------------------------------------------------- /pkgs/web_socket/lib/src/utils.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:convert'; 6 | 7 | /// Throw if the given close code is not valid. 8 | void checkCloseCode(int? code) { 9 | if (code != null && code != 1000 && !(code >= 3000 && code <= 4999)) { 10 | throw ArgumentError('Invalid argument: $code, close code must be 1000 or ' 11 | 'in the range 3000-4999'); 12 | } 13 | } 14 | 15 | /// Throw if the given close reason is not valid. 16 | void checkCloseReason(String? reason) { 17 | if (reason != null && utf8.encode(reason).length > 123) { 18 | throw ArgumentError.value(reason, 'reason', 19 | 'reason must be <= 123 bytes long when encoded as UTF-8'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pkgs/web_socket/lib/testing.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/fake_web_socket.dart' show fakes; 6 | -------------------------------------------------------------------------------- /pkgs/web_socket/lib/web_socket.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/web_socket.dart'; 6 | -------------------------------------------------------------------------------- /pkgs/web_socket/mono_pkg.yaml: -------------------------------------------------------------------------------- 1 | sdk: 2 | - pubspec 3 | - dev 4 | 5 | stages: 6 | - analyze_and_format: 7 | - analyze: --fatal-infos 8 | - format: 9 | sdk: 10 | - dev 11 | - unit_test: 12 | - test: --test-randomize-ordering-seed=random -p vm 13 | os: 14 | - linux 15 | - test: --test-randomize-ordering-seed=random -p chrome -c dart2js 16 | os: 17 | - linux 18 | -------------------------------------------------------------------------------- /pkgs/web_socket/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: web_socket 2 | description: >- 3 | Any easy-to-use library for communicating with WebSockets 4 | that has multiple implementations. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/web_socket 6 | version: 1.0.1 7 | 8 | environment: 9 | sdk: ^3.4.0 10 | 11 | dependencies: 12 | web: '>=0.5.0 <2.0.0' 13 | 14 | dev_dependencies: 15 | dart_flutter_team_lints: ^3.0.0 16 | test: ^1.24.0 17 | web_socket_conformance_tests: 18 | path: ../web_socket_conformance_tests/ 19 | -------------------------------------------------------------------------------- /pkgs/web_socket/test/browser_web_socket_conformance_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('browser') 6 | library; 7 | 8 | import 'package:test/test.dart'; 9 | import 'package:web_socket/browser_web_socket.dart'; 10 | import 'package:web_socket_conformance_tests/web_socket_conformance_tests.dart'; 11 | 12 | void main() { 13 | testAll(BrowserWebSocket.connect); 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/web_socket/test/io_web_socket_conformance_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('vm') 6 | library; 7 | 8 | import 'package:test/test.dart'; 9 | import 'package:web_socket/io_web_socket.dart'; 10 | import 'package:web_socket_conformance_tests/web_socket_conformance_tests.dart'; 11 | 12 | void main() { 13 | testAll(IOWebSocket.connect); 14 | } 15 | -------------------------------------------------------------------------------- /pkgs/web_socket/test/websocket_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:web_socket/web_socket.dart'; 6 | import 'package:web_socket_conformance_tests/web_socket_conformance_tests.dart'; 7 | 8 | void main() { 9 | testAll(WebSocket.connect); 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/web_socket_channel/.gitignore: -------------------------------------------------------------------------------- 1 | .dart_tool/ 2 | .packages 3 | pubspec.lock 4 | -------------------------------------------------------------------------------- /pkgs/web_socket_channel/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:dart_flutter_team_lints/analysis_options.yaml 2 | 3 | analyzer: 4 | language: 5 | strict-casts: true 6 | 7 | linter: 8 | rules: 9 | - avoid_bool_literals_in_conditional_expressions 10 | - avoid_classes_with_only_static_members 11 | - avoid_private_typedef_functions 12 | - avoid_redundant_argument_values 13 | - avoid_returning_this 14 | - avoid_unused_constructor_parameters 15 | - avoid_void_async 16 | - cancel_subscriptions 17 | - join_return_with_assignment 18 | - literal_only_boolean_expressions 19 | - missing_whitespace_between_adjacent_strings 20 | - no_adjacent_strings_in_list 21 | - no_runtimeType_toString 22 | - prefer_const_declarations 23 | - prefer_expression_function_bodies 24 | - prefer_final_locals 25 | - prefer_void_to_null 26 | - unnecessary_await_in_return 27 | - use_string_buffers 28 | -------------------------------------------------------------------------------- /pkgs/web_socket_channel/example/example.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:web_socket_channel/status.dart' as status; 6 | import 'package:web_socket_channel/web_socket_channel.dart'; 7 | 8 | void main() async { 9 | final wsUrl = Uri.parse('ws://example.com'); 10 | final channel = WebSocketChannel.connect(wsUrl); 11 | 12 | await channel.ready; 13 | 14 | channel.stream.listen((message) { 15 | channel.sink.add('received!'); 16 | channel.sink.close(status.goingAway); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /pkgs/web_socket_channel/lib/src/exception.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'channel.dart'; 6 | 7 | /// An exception thrown by a [WebSocketChannel]. 8 | class WebSocketChannelException implements Exception { 9 | final String? message; 10 | 11 | /// The exception that caused this one, if available. 12 | final Object? inner; 13 | 14 | WebSocketChannelException([this.message]) : inner = null; 15 | 16 | WebSocketChannelException.from(this.inner) : message = inner.toString(); 17 | 18 | @override 19 | String toString() => message == null 20 | ? 'WebSocketChannelException' 21 | : 'WebSocketChannelException: $message'; 22 | } 23 | -------------------------------------------------------------------------------- /pkgs/web_socket_channel/lib/web_socket_channel.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/channel.dart'; 6 | export 'src/exception.dart'; 7 | -------------------------------------------------------------------------------- /pkgs/web_socket_channel/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: web_socket_channel 2 | version: 3.0.3 3 | description: >- 4 | A WebSocket API that enables cross-platform communication via StreamChannel. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/web_socket_channel 6 | 7 | environment: 8 | sdk: ^3.3.0 9 | 10 | dependencies: 11 | async: ^2.5.0 12 | crypto: ^3.0.0 13 | stream_channel: ^2.1.0 14 | web: '>=0.5.0 <2.0.0' 15 | web_socket: '>=0.1.5 <2.0.0' 16 | 17 | dev_dependencies: 18 | dart_flutter_team_lints: ^3.0.0 19 | test: ^1.25.2 20 | 21 | topics: 22 | - web 23 | - http 24 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/.gitattributes: -------------------------------------------------------------------------------- 1 | lib/src/*_server_vm.dart linguist-generated=true 2 | lib/src/*_server_web.dart linguist-generated=true 3 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/close_local_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'close_local_server.dart'; 6 | 7 | /// Starts the redirect test HTTP server in the same process. 8 | Future> startServer() async { 9 | final controller = StreamChannelController(sync: true); 10 | hybridMain(controller.foreign); 11 | return controller.local; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/close_local_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | /// Starts the redirect test HTTP server out-of-process. 7 | Future> startServer() async => spawnHybridUri(Uri( 8 | scheme: 'package', 9 | path: 'web_socket_conformance_tests/src/close_local_server.dart')); 10 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/close_remote_server.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | import 'dart:io'; 7 | 8 | import 'package:stream_channel/stream_channel.dart'; 9 | 10 | /// Starts an WebSocket server that sends a Close frame after receiving any 11 | /// data. 12 | void hybridMain(StreamChannel channel) async { 13 | late HttpServer server; 14 | 15 | server = (await HttpServer.bind('localhost', 0)) 16 | ..listen((request) async { 17 | final webSocket = await WebSocketTransformer.upgrade( 18 | request, 19 | ); 20 | 21 | webSocket.listen((event) { 22 | channel.sink.add(event); 23 | webSocket.close(4123, 'server closed the connection'); 24 | }); 25 | }); 26 | 27 | channel.sink.add(server.port); 28 | await channel 29 | .stream.first; // Any writes indicates that the server should exit. 30 | unawaited(server.close()); 31 | } 32 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/close_remote_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'close_remote_server.dart'; 6 | 7 | /// Starts the redirect test HTTP server in the same process. 8 | Future> startServer() async { 9 | final controller = StreamChannelController(sync: true); 10 | hybridMain(controller.foreign); 11 | return controller.local; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/close_remote_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | /// Starts the redirect test HTTP server out-of-process. 7 | Future> startServer() async => spawnHybridUri(Uri( 8 | scheme: 'package', 9 | path: 'web_socket_conformance_tests/src/close_remote_server.dart')); 10 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/connect_uri_tests.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:test/test.dart'; 6 | import 'package:web_socket/web_socket.dart'; 7 | 8 | /// Tests that the [WebSocket] rejects invalid connection URIs. 9 | void testConnectUri( 10 | Future Function(Uri uri, {Iterable? protocols}) 11 | channelFactory) { 12 | group('connect uri', () { 13 | test('no protocol', () async { 14 | await expectLater(() => channelFactory(Uri.https('www.example.com', '/')), 15 | throwsA(isA())); 16 | }); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/continuously_writing_server.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | import 'dart:io'; 7 | 8 | import 'package:stream_channel/stream_channel.dart'; 9 | 10 | /// Starts an WebSocket server that sends a lot of data to the peer. 11 | void hybridMain(StreamChannel channel) async { 12 | late HttpServer server; 13 | 14 | server = (await HttpServer.bind('localhost', 0)) 15 | ..transform(WebSocketTransformer()).listen((WebSocket webSocket) { 16 | for (var i = 0; i < 10000; ++i) { 17 | webSocket.add('Hello World!'); 18 | } 19 | }); 20 | 21 | channel.sink.add(server.port); 22 | await channel 23 | .stream.first; // Any writes indicates that the server should exit. 24 | unawaited(server.close()); 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/continuously_writing_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'continuously_writing_server.dart'; 6 | 7 | /// Starts the redirect test HTTP server in the same process. 8 | Future> startServer() async { 9 | final controller = StreamChannelController(sync: true); 10 | hybridMain(controller.foreign); 11 | return controller.local; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/continuously_writing_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | /// Starts the redirect test HTTP server out-of-process. 7 | Future> startServer() async => spawnHybridUri(Uri( 8 | scheme: 'package', 9 | path: 'web_socket_conformance_tests/src/continuously_writing_server.dart')); 10 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/disconnect_after_upgrade_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'disconnect_after_upgrade_server.dart'; 6 | 7 | /// Starts the redirect test HTTP server in the same process. 8 | Future> startServer() async { 9 | final controller = StreamChannelController(sync: true); 10 | hybridMain(controller.foreign); 11 | return controller.local; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/disconnect_after_upgrade_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | /// Starts the redirect test HTTP server out-of-process. 7 | Future> startServer() async => spawnHybridUri(Uri( 8 | scheme: 'package', 9 | path: 10 | 'web_socket_conformance_tests/src/disconnect_after_upgrade_server.dart')); 11 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/echo_server.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | import 'dart:io'; 7 | 8 | import 'package:stream_channel/stream_channel.dart'; 9 | 10 | /// Starts an WebSocket server that echos the payload of the request. 11 | void hybridMain(StreamChannel channel) async { 12 | late HttpServer server; 13 | 14 | server = (await HttpServer.bind('localhost', 0)) 15 | ..transform(WebSocketTransformer()) 16 | .listen((WebSocket webSocket) => webSocket.listen(webSocket.add)); 17 | 18 | channel.sink.add(server.port); 19 | await channel 20 | .stream.first; // Any writes indicates that the server should exit. 21 | unawaited(server.close()); 22 | } 23 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/echo_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'echo_server.dart'; 6 | 7 | /// Starts the redirect test HTTP server in the same process. 8 | Future> startServer() async { 9 | final controller = StreamChannelController(sync: true); 10 | hybridMain(controller.foreign); 11 | return controller.local; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/echo_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | /// Starts the redirect test HTTP server out-of-process. 7 | Future> startServer() async => spawnHybridUri(Uri( 8 | scheme: 'package', 9 | path: 'web_socket_conformance_tests/src/echo_server.dart')); 10 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/no_upgrade_server.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | import 'dart:io'; 7 | import 'package:stream_channel/stream_channel.dart'; 8 | 9 | /// Starts an WebSocket server that closes the HTTP connection before WebSocket 10 | /// upgrade. 11 | void hybridMain(StreamChannel channel) async { 12 | final server = (await HttpServer.bind('localhost', 0)) 13 | ..listen((request) async { 14 | request.response.statusCode = 200; 15 | await request.response.close(); 16 | }); 17 | channel.sink.add(server.port); 18 | 19 | await channel 20 | .stream.first; // Any writes indicates that the server should exit. 21 | unawaited(server.close()); 22 | } 23 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/no_upgrade_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'no_upgrade_server.dart'; 6 | 7 | /// Starts the redirect test HTTP server in the same process. 8 | Future> startServer() async { 9 | final controller = StreamChannelController(sync: true); 10 | hybridMain(controller.foreign); 11 | return controller.local; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/no_upgrade_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | /// Starts the redirect test HTTP server out-of-process. 7 | Future> startServer() async => spawnHybridUri(Uri( 8 | scheme: 'package', 9 | path: 'web_socket_conformance_tests/src/no_upgrade_server.dart')); 10 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/peer_protocol_errors_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'peer_protocol_errors_server.dart'; 6 | 7 | /// Starts the redirect test HTTP server in the same process. 8 | Future> startServer() async { 9 | final controller = StreamChannelController(sync: true); 10 | hybridMain(controller.foreign); 11 | return controller.local; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/peer_protocol_errors_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | /// Starts the redirect test HTTP server out-of-process. 7 | Future> startServer() async => spawnHybridUri(Uri( 8 | scheme: 'package', 9 | path: 'web_socket_conformance_tests/src/peer_protocol_errors_server.dart')); 10 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/protocol_server_vm.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | 5 | import 'protocol_server.dart'; 6 | 7 | /// Starts the redirect test HTTP server in the same process. 8 | Future> startServer() async { 9 | final controller = StreamChannelController(sync: true); 10 | hybridMain(controller.foreign); 11 | return controller.local; 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/lib/src/protocol_server_web.dart: -------------------------------------------------------------------------------- 1 | // Generated by generate_server_wrappers.dart. Do not edit. 2 | 3 | import 'package:stream_channel/stream_channel.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | /// Starts the redirect test HTTP server out-of-process. 7 | Future> startServer() async => spawnHybridUri(Uri( 8 | scheme: 'package', 9 | path: 'web_socket_conformance_tests/src/protocol_server.dart')); 10 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/mono_pkg.yaml: -------------------------------------------------------------------------------- 1 | sdk: 2 | - pubspec 3 | - dev 4 | 5 | stages: 6 | - analyze_and_format: 7 | - analyze: --fatal-infos 8 | - format: 9 | sdk: 10 | - dev 11 | -------------------------------------------------------------------------------- /pkgs/web_socket_conformance_tests/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: web_socket_conformance_tests 2 | description: >- 3 | A library that tests whether implementations of `package:web_socket`'s 4 | `WebSocket` class behave as expected. 5 | repository: https://github.com/dart-lang/http/tree/master/pkgs/web_socket_conformance_tests 6 | 7 | publish_to: none 8 | 9 | environment: 10 | sdk: ^3.4.0 11 | 12 | dependencies: 13 | async: ^2.11.0 14 | crypto: ^3.0.3 15 | dart_style: '>2.3.7 <4.0.0' 16 | stream_channel: ^2.1.2 17 | test: ^1.24.0 18 | web_socket: '>=0.1.5 <2.0.0' 19 | 20 | dev_dependencies: 21 | dart_flutter_team_lints: ^3.0.0 22 | --------------------------------------------------------------------------------