From b21dce5f4964adf1e6c90225377a00f65652c428 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 20 Feb 2024 14:00:12 -0800 Subject: [PATCH] [web] Updates package:web dependency to ^0.5.0. (#5791) This PR updates the packages that are using `package:web` to version `^0.5.0`. Ancilliary changes: * Bump `environment` to `flutter: ">=3.19.0"` and `sdk: ^3.3.0`. * Bump version to next `Y` * Clean-up code that was kept for compatibility with versions of `web: <0.5.0`. The main exception to this is `package:google_sign_in_web`, which depends on a version of `google_identity_services_web` that has a dependency on package:web that is `<0.5.0`, so that package needs to have a range until `google_identity_services_web` gets published with the new ^0.5.0 dependency. Co-Authored-By: David Iglesias --- packages/cross_file/CHANGELOG.md | 5 +- packages/cross_file/lib/src/types/html.dart | 8 +- packages/cross_file/pubspec.yaml | 6 +- .../cross_file/test/x_file_html_test.dart | 6 +- .../file_selector_web/CHANGELOG.md | 5 +- .../integration_test/dom_helper_test.dart | 35 +- .../file_selector_web/example/pubspec.yaml | 6 +- .../file_selector_web/lib/src/dom_helper.dart | 11 +- .../file_selector_web/pubspec.yaml | 8 +- .../google_identity_services_web/CHANGELOG.md | 5 + .../integration_test/js_interop_id_test.dart | 4 +- .../example/pubspec.yaml | 3 +- .../src/js_interop/google_accounts_id.dart | 4 +- .../src/js_interop/package_web_tweaks.dart | 67 ++- .../lib/src/js_loader.dart | 8 +- .../google_identity_services_web/pubspec.yaml | 6 +- .../google_sign_in_web/CHANGELOG.md | 5 + .../google_sign_in_web/example/pubspec.yaml | 6 +- .../google_sign_in_web/pubspec.yaml | 8 +- .../image_picker_for_web/example/pubspec.yaml | 1 - packages/metrics_center/CHANGELOG.md | 3 +- packages/metrics_center/pubspec.yaml | 4 +- .../test/gcs_lock_test.mocks.dart | 392 +++++++++++++----- .../pointer_interceptor_web/CHANGELOG.md | 5 + .../example/pubspec.yaml | 6 +- .../pointer_interceptor_web/pubspec.yaml | 8 +- .../shared_preferences_web/CHANGELOG.md | 5 + .../shared_preferences_web_test.dart | 3 +- .../example/pubspec.yaml | 3 +- .../shared_preferences_web/pubspec.yaml | 8 +- .../url_launcher_web/CHANGELOG.md | 5 + .../integration_test/link_widget_test.dart | 9 +- .../url_launcher_web_test.dart | 13 +- .../url_launcher_web/example/pubspec.yaml | 6 +- .../url_launcher_web/lib/src/link.dart | 15 +- .../url_launcher_web/pubspec.yaml | 8 +- .../video_player_web/CHANGELOG.md | 4 +- .../example/integration_test/utils.dart | 44 +- .../video_player_web/example/pubspec.yaml | 8 +- .../video_player_web/pubspec.yaml | 6 +- packages/web_benchmarks/CHANGELOG.md | 5 +- packages/web_benchmarks/lib/client.dart | 12 +- packages/web_benchmarks/lib/src/recorder.dart | 2 +- packages/web_benchmarks/pubspec.yaml | 9 +- 44 files changed, 500 insertions(+), 290 deletions(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index c6113b298146..52b11b97de35 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.3.4 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates to web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. ## 0.3.3+8 diff --git a/packages/cross_file/lib/src/types/html.dart b/packages/cross_file/lib/src/types/html.dart index 9eb95b448d88..a58dc35278b5 100644 --- a/packages/cross_file/lib/src/types/html.dart +++ b/packages/cross_file/lib/src/types/html.dart @@ -66,9 +66,7 @@ class XFile extends XFileBase { super(path) { if (path == null) { _browserBlob = _createBlobFromBytes(bytes, mimeType); - // TODO(kevmoo): drop ignore when pkg:web constraint excludes v0.3 - // ignore: unnecessary_cast - _path = URL.createObjectURL(_browserBlob! as JSObject); + _path = URL.createObjectURL(_browserBlob!); } else { _path = path; } @@ -131,9 +129,7 @@ class XFile extends XFileBase { // Attempt to re-hydrate the blob from the `path` via a (local) HttpRequest. // Note that safari hangs if the Blob is >=4GB, so bail out in that case. - // TODO(kevmoo): Remove ignore and fix when the MIN Dart SDK is 3.3 - // ignore: unnecessary_non_null_assertion - if (isSafari() && _length != null && _length! >= _fourGigabytes) { + if (isSafari() && _length != null && _length >= _fourGigabytes) { throw Exception('Safari cannot handle XFiles larger than 4GB.'); } diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index c2b8f2f53424..b7b7f7af1088 100644 --- a/packages/cross_file/pubspec.yaml +++ b/packages/cross_file/pubspec.yaml @@ -2,14 +2,14 @@ name: cross_file description: An abstraction to allow working with files across multiple platforms. repository: https://github.com/flutter/packages/tree/main/packages/cross_file issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cross_file%22 -version: 0.3.3+8 +version: 0.3.4 environment: - sdk: ^3.2.0 + sdk: ^3.3.0 dependencies: meta: ^1.3.0 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: path: ^1.8.1 diff --git a/packages/cross_file/test/x_file_html_test.dart b/packages/cross_file/test/x_file_html_test.dart index 4b002cac158b..4b1dabd1583d 100644 --- a/packages/cross_file/test/x_file_html_test.dart +++ b/packages/cross_file/test/x_file_html_test.dart @@ -69,10 +69,10 @@ void main() { test('Stores data as a Blob', () async { // Read the blob from its path 'natively' final html.Response response = - (await html.window.fetch(file.path.toJS).toDart)! as html.Response; + await html.window.fetch(file.path.toJS).toDart; - final JSAny? arrayBuffer = await response.arrayBuffer().toDart; - final ByteBuffer data = (arrayBuffer! as JSArrayBuffer).toDart; + final JSAny arrayBuffer = await response.arrayBuffer().toDart; + final ByteBuffer data = (arrayBuffer as JSArrayBuffer).toDart; expect(data.asUint8List(), equals(bytes)); }); diff --git a/packages/file_selector/file_selector_web/CHANGELOG.md b/packages/file_selector/file_selector_web/CHANGELOG.md index 40b7a853e5b3..e2dd2901aa8e 100644 --- a/packages/file_selector/file_selector_web/CHANGELOG.md +++ b/packages/file_selector/file_selector_web/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.9.4 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.16.0`. ## 0.9.3 diff --git a/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart b/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart index 1cec6fc7ad10..c4697a70a5d4 100644 --- a/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart +++ b/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart @@ -18,11 +18,10 @@ void main() { FileList? createFileList(List files) { final DataTransfer dataTransfer = DataTransfer(); + // Tear-offs of external extension type interop member 'add' are disallowed. + // ignore: prefer_foreach for (final File e in files) { - // TODO(srujzs): This is necessary in order to support package:web 0.4.0. - // This was not needed with 0.3.0, hence the lint. - // ignore: unnecessary_cast - dataTransfer.items.add(e as JSAny); + dataTransfer.items.add(e); } return dataTransfer.files; } @@ -46,13 +45,8 @@ void main() { }); group('getFiles', () { - final File mockFile1 = - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - File(['123456'].jsify as JSArray, 'file1.txt'); - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - final File mockFile2 = File([].jsify as JSArray, 'file2.txt'); + final File mockFile1 = File(['123456'.toJS].toJS, 'file1.txt'); + final File mockFile2 = File([].toJS, 'file2.txt'); testWidgets('works', (_) async { final Future> futureFiles = domHelper.getFiles( @@ -114,10 +108,7 @@ void main() { testWidgets('sets the attributes and clicks it', (_) async { const String accept = '.jpg,.png'; const bool multiple = true; - bool wasClicked = false; - - //ignore: unawaited_futures - input.onClick.first.then((_) => wasClicked = true); + final Future wasClicked = input.onClick.first.then((_) => true); final Future> futureFile = domHelper.getFiles( accept: accept, @@ -125,21 +116,19 @@ void main() { input: input, ); - expect(input.matches('body'), true); + expect(input.isConnected, true, + reason: 'input must be injected into the DOM'); expect(input.accept, accept); expect(input.multiple, multiple); - expect( - wasClicked, - true, - reason: - 'The should be clicked otherwise no dialog will be shown', - ); + expect(await wasClicked, true, + reason: + 'The should be clicked otherwise no dialog will be shown'); setFilesAndTriggerChange([]); await futureFile; // It should be already removed from the DOM after the file is resolved. - expect(input.parentElement, isNull); + expect(input.isConnected, isFalse); }); }); }); diff --git a/packages/file_selector/file_selector_web/example/pubspec.yaml b/packages/file_selector/file_selector_web/example/pubspec.yaml index 725ace61b00b..689ab97657e7 100644 --- a/packages/file_selector/file_selector_web/example/pubspec.yaml +++ b/packages/file_selector/file_selector_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: file_selector_web_integration_tests publish_to: none environment: - sdk: ^3.1.0 - flutter: ">=3.13.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: file_selector_platform_interface: ^2.6.0 @@ -11,7 +11,7 @@ dependencies: path: ../ flutter: sdk: flutter - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/file_selector/file_selector_web/lib/src/dom_helper.dart b/packages/file_selector/file_selector_web/lib/src/dom_helper.dart index 7684a12286d7..309f0ee432f1 100644 --- a/packages/file_selector/file_selector_web/lib/src/dom_helper.dart +++ b/packages/file_selector/file_selector_web/lib/src/dom_helper.dart @@ -14,11 +14,11 @@ import 'package:web/helpers.dart'; class DomHelper { /// Default constructor, initializes the container DOM element. DomHelper() { - final Element body = querySelector('body')!; + final Element body = document.querySelector('body')!; body.appendChild(_container); } - final Element _container = createElementTag('file-selector'); + final Element _container = document.createElement('file-selector'); /// Sets the attributes and waits for a file to be selected. Future> getFiles({ @@ -28,7 +28,7 @@ class DomHelper { }) { final Completer> completer = Completer>(); final HTMLInputElement inputElement = - input ?? (createElementTag('input') as HTMLInputElement) + input ?? (document.createElement('input') as HTMLInputElement) ..type = 'file'; _container.appendChild( @@ -72,10 +72,7 @@ class DomHelper { } XFile _convertFileToXFile(File file) => XFile( - // TODO(srujzs): This is necessary in order to support package:web 0.4.0. - // This was not needed with 0.3.0, hence the lint. - // ignore: unnecessary_cast - URL.createObjectURL(file as JSObject), + URL.createObjectURL(file), name: file.name, length: file.size, lastModified: DateTime.fromMillisecondsSinceEpoch(file.lastModified), diff --git a/packages/file_selector/file_selector_web/pubspec.yaml b/packages/file_selector/file_selector_web/pubspec.yaml index 3c3ca15c3aa9..edc74e3064ea 100644 --- a/packages/file_selector/file_selector_web/pubspec.yaml +++ b/packages/file_selector/file_selector_web/pubspec.yaml @@ -2,11 +2,11 @@ name: file_selector_web description: Web platform implementation of file_selector repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.9.3 +version: 0.9.4 environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -22,7 +22,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/google_identity_services_web/CHANGELOG.md b/packages/google_identity_services_web/CHANGELOG.md index 92c96c07bdce..fe739cab00e5 100644 --- a/packages/google_identity_services_web/CHANGELOG.md +++ b/packages/google_identity_services_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.1 + +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. + ## 0.3.0+2 * Adds `fedcm_auto` to `CredentialSelectBy` enum. diff --git a/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart b/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart index 77914b746740..1d1c5c29ea81 100644 --- a/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart +++ b/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart @@ -66,9 +66,7 @@ void main() async { expectConfigValue('login_uri', 'https://www.example.com/login'); expectConfigValue('native_callback', utils.isAJs('function')); expectConfigValue('cancel_on_tap_outside', isFalse); - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - expectConfigValue('allowed_parent_origin', isA()); + expectConfigValue('allowed_parent_origin', isA>()); expectConfigValue('prompt_parent_id', 'some_dom_id'); expectConfigValue('nonce', 's0m3_r4ndOM_vALu3'); expectConfigValue('context', 'signin'); diff --git a/packages/google_identity_services_web/example/pubspec.yaml b/packages/google_identity_services_web/example/pubspec.yaml index e53f85dff1cb..46bdaf47c9e0 100644 --- a/packages/google_identity_services_web/example/pubspec.yaml +++ b/packages/google_identity_services_web/example/pubspec.yaml @@ -1,7 +1,6 @@ name: google_identity_services_web_example description: An example for the google_identity_services_web package, OneTap. publish_to: 'none' -version: 0.0.1 environment: flutter: ">=3.16.0" @@ -13,7 +12,7 @@ dependencies: google_identity_services_web: path: ../ http: ">=0.13.0 <2.0.0" - web: ">=0.3.0 <0.5.0" + web: ^0.5.0 dev_dependencies: build_runner: ^2.1.10 # To extract README excerpts only. diff --git a/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart b/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart index a02197e0cf83..8467854640e8 100644 --- a/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart +++ b/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart @@ -338,9 +338,7 @@ abstract class IdConfiguration { JSString? context, JSString? state_cookie_domain, JSString? ux_mode, - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray? allowed_parent_origin, + JSArray? allowed_parent_origin, JSFunction? intermediate_iframe_close_callback, JSBoolean? itp_support, JSString? login_hint, diff --git a/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart b/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart index 76dc411c103e..b05fbc5a49a2 100644 --- a/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart +++ b/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart @@ -2,34 +2,75 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// Provides some useful tweaks to `package:web`. -library package_web_tweaks; - import 'dart:js_interop'; + import 'package:web/web.dart' as web; +// TODO(kevmoo): Make this file unnecessary, https://github.com/dart-lang/web/issues/175 + /// This extension gives web.window a nullable getter to the `trustedTypes` /// property, which needs to be used to check for feature support. extension NullableTrustedTypesGetter on web.Window { + /// (Nullable) Bindings to window.trustedTypes. + /// + /// This may be null if the browser doesn't support the Trusted Types API. + /// + /// See: https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API + @JS('trustedTypes') + external TrustedTypePolicyFactory? get nullableTrustedTypes; + + /// Bindings to window.trustedTypes. + /// + /// This will crash if accessed in a browser that doesn't support the + /// Trusted Types API. /// + /// See: https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API @JS('trustedTypes') - external web.TrustedTypePolicyFactory? get nullableTrustedTypes; + external TrustedTypePolicyFactory get trustedTypes; } -/// This extension allows a trusted type policy to create a script URL without -/// the `args` parameter (which in Chrome currently fails). -extension CreateScriptUrlWithoutArgs on web.TrustedTypePolicy { +/// This extension allows setting a TrustedScriptURL as the src of a script element, +/// which currently only accepts a string. +extension TrustedTypeSrcAttribute on web.HTMLScriptElement { + @JS('src') + external set trustedSrc(TrustedScriptURL value); +} + +// TODO(kevmoo): drop all of this once `pkg:web` publishes `0.5.1`. + +/// Bindings to a JS TrustedScriptURL. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedScriptURL +extension type TrustedScriptURL._(JSObject _) implements JSObject {} + +/// Bindings to a JS TrustedTypePolicyFactory. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicyFactory +extension type TrustedTypePolicyFactory._(JSObject _) implements JSObject { + /// + external TrustedTypePolicy createPolicy( + String policyName, [ + TrustedTypePolicyOptions policyOptions, + ]); +} + +/// Bindings to a JS TrustedTypePolicy. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicy +extension type TrustedTypePolicy._(JSObject _) implements JSObject { /// @JS('createScriptURL') - external web.TrustedScriptURL createScriptURLNoArgs( + external TrustedScriptURL createScriptURLNoArgs( String input, ); } -/// This extension allows setting a TrustedScriptURL as the src of a script element, -/// which currently only accepts a string. -extension TrustedTypeSrcAttribute on web.HTMLScriptElement { +/// Bindings to a JS TrustedTypePolicyOptions (anonymous). +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicyFactory/createPolicy#policyoptions +extension type TrustedTypePolicyOptions._(JSObject _) implements JSObject { /// - @JS('src') - external set srcTT(web.TrustedScriptURL value); + external factory TrustedTypePolicyOptions({ + JSFunction createScriptURL, + }); } diff --git a/packages/google_identity_services_web/lib/src/js_loader.dart b/packages/google_identity_services_web/lib/src/js_loader.dart index bd876f98c5ce..620ad2129269 100644 --- a/packages/google_identity_services_web/lib/src/js_loader.dart +++ b/packages/google_identity_services_web/lib/src/js_loader.dart @@ -25,15 +25,15 @@ Future loadWebSdk({ onGoogleLibraryLoad = () => completer.complete(); // If TrustedTypes are available, prepare a trusted URL. - web.TrustedScriptURL? trustedUrl; + TrustedScriptURL? trustedUrl; if (web.window.nullableTrustedTypes != null) { web.console.debug( 'TrustedTypes available. Creating policy: $trustedTypePolicyName'.toJS, ); try { - final web.TrustedTypePolicy policy = web.window.trustedTypes.createPolicy( + final TrustedTypePolicy policy = web.window.trustedTypes.createPolicy( trustedTypePolicyName, - web.TrustedTypePolicyOptions( + TrustedTypePolicyOptions( createScriptURL: ((JSString url) => _url).toJS, )); trustedUrl = policy.createScriptURLNoArgs(_url); @@ -47,7 +47,7 @@ Future loadWebSdk({ ..async = true ..defer = true; if (trustedUrl != null) { - script.srcTT = trustedUrl; + script.trustedSrc = trustedUrl; } else { script.src = _url; } diff --git a/packages/google_identity_services_web/pubspec.yaml b/packages/google_identity_services_web/pubspec.yaml index 2f1e5b913901..84502a1f6a49 100644 --- a/packages/google_identity_services_web/pubspec.yaml +++ b/packages/google_identity_services_web/pubspec.yaml @@ -2,14 +2,14 @@ name: google_identity_services_web description: A Dart JS-interop layer for Google Identity Services. Google's new sign-in SDK for Web that supports multiple types of credentials. repository: https://github.com/flutter/packages/tree/main/packages/google_identity_services_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_identiy_services_web%22 -version: 0.3.0+2 +version: 0.3.1 environment: - sdk: ">=3.2.0 <4.0.0" + sdk: ^3.3.0 dependencies: meta: ^1.3.0 - web: ">=0.3.0 <0.5.0" + web: ^0.5.0 dev_dependencies: path: ^1.8.1 diff --git a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md index 73a6b806ac13..2c9c5863c8e2 100644 --- a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.12.3+3 + +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. +* Prepares update to package `web: ^0.5.0`. + ## 0.12.3+2 * Fixes new lint warnings. diff --git a/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml index a7c48aa6d3bd..1c53b0fa93c9 100644 --- a/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: google_sign_in_web_integration_tests publish_to: none environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: cupertino_icons: ^1.0.2 @@ -22,7 +22,7 @@ dev_dependencies: integration_test: sdk: flutter mockito: 5.4.4 - web: ">=0.3.0 <0.5.0" + web: ">=0.3.0 <0.6.0" flutter: uses-material-design: true diff --git a/packages/google_sign_in/google_sign_in_web/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/pubspec.yaml index 834e666b34ae..82b9cd3cd289 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -3,11 +3,11 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android, iOS and Web. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 0.12.3+2 +version: 0.12.3+3 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -25,7 +25,7 @@ dependencies: google_identity_services_web: ^0.3.0 google_sign_in_platform_interface: ^2.4.0 http: ">=0.13.0 <2.0.0" - web: ">=0.3.0 <0.5.0" + web: ">=0.3.0 <0.6.0" # because google_identity_services dev_dependencies: flutter_test: diff --git a/packages/image_picker/image_picker_for_web/example/pubspec.yaml b/packages/image_picker/image_picker_for_web/example/pubspec.yaml index 4e1a99bb5530..2efe50fa6375 100644 --- a/packages/image_picker/image_picker_for_web/example/pubspec.yaml +++ b/packages/image_picker/image_picker_for_web/example/pubspec.yaml @@ -17,4 +17,3 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - js: ^0.6.3 diff --git a/packages/metrics_center/CHANGELOG.md b/packages/metrics_center/CHANGELOG.md index 0d589218f8ab..a661251dc1d2 100644 --- a/packages/metrics_center/CHANGELOG.md +++ b/packages/metrics_center/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 1.0.13 * Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates dependency on `package:googleapis` to `^12.0.0`. ## 1.0.12 diff --git a/packages/metrics_center/pubspec.yaml b/packages/metrics_center/pubspec.yaml index efc8ffcd5d92..581be39e283c 100644 --- a/packages/metrics_center/pubspec.yaml +++ b/packages/metrics_center/pubspec.yaml @@ -1,5 +1,5 @@ name: metrics_center -version: 1.0.12 +version: 1.0.13 description: Support multiple performance metrics sources/formats and destinations. repository: https://github.com/flutter/packages/tree/main/packages/metrics_center @@ -12,7 +12,7 @@ dependencies: _discoveryapis_commons: ^1.0.0 crypto: ^3.0.1 gcloud: ^0.8.2 - googleapis: ^3.0.0 + googleapis: ^12.0.0 googleapis_auth: ^1.1.0 http: ">=0.13.0 <2.0.0" diff --git a/packages/metrics_center/test/gcs_lock_test.mocks.dart b/packages/metrics_center/test/gcs_lock_test.mocks.dart index f28daf64f6e5..d013ac823f25 100644 --- a/packages/metrics_center/test/gcs_lock_test.mocks.dart +++ b/packages/metrics_center/test/gcs_lock_test.mocks.dart @@ -60,9 +60,20 @@ class _FakeStreamedResponse_2 extends _i1.SmartFake ); } -class _FakeBucketAccessControlsResource_3 extends _i1.SmartFake +class _FakeAnywhereCacheResource_3 extends _i1.SmartFake + implements _i4.AnywhereCacheResource { + _FakeAnywhereCacheResource_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeBucketAccessControlsResource_4 extends _i1.SmartFake implements _i4.BucketAccessControlsResource { - _FakeBucketAccessControlsResource_3( + _FakeBucketAccessControlsResource_4( Object parent, Invocation parentInvocation, ) : super( @@ -71,9 +82,9 @@ class _FakeBucketAccessControlsResource_3 extends _i1.SmartFake ); } -class _FakeBucketsResource_4 extends _i1.SmartFake +class _FakeBucketsResource_5 extends _i1.SmartFake implements _i4.BucketsResource { - _FakeBucketsResource_4( + _FakeBucketsResource_5( Object parent, Invocation parentInvocation, ) : super( @@ -82,9 +93,9 @@ class _FakeBucketsResource_4 extends _i1.SmartFake ); } -class _FakeChannelsResource_5 extends _i1.SmartFake +class _FakeChannelsResource_6 extends _i1.SmartFake implements _i4.ChannelsResource { - _FakeChannelsResource_5( + _FakeChannelsResource_6( Object parent, Invocation parentInvocation, ) : super( @@ -93,9 +104,20 @@ class _FakeChannelsResource_5 extends _i1.SmartFake ); } -class _FakeDefaultObjectAccessControlsResource_6 extends _i1.SmartFake +class _FakeDefaultObjectAccessControlsResource_7 extends _i1.SmartFake implements _i4.DefaultObjectAccessControlsResource { - _FakeDefaultObjectAccessControlsResource_6( + _FakeDefaultObjectAccessControlsResource_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeManagedFoldersResource_8 extends _i1.SmartFake + implements _i4.ManagedFoldersResource { + _FakeManagedFoldersResource_8( Object parent, Invocation parentInvocation, ) : super( @@ -104,9 +126,9 @@ class _FakeDefaultObjectAccessControlsResource_6 extends _i1.SmartFake ); } -class _FakeNotificationsResource_7 extends _i1.SmartFake +class _FakeNotificationsResource_9 extends _i1.SmartFake implements _i4.NotificationsResource { - _FakeNotificationsResource_7( + _FakeNotificationsResource_9( Object parent, Invocation parentInvocation, ) : super( @@ -115,9 +137,9 @@ class _FakeNotificationsResource_7 extends _i1.SmartFake ); } -class _FakeObjectAccessControlsResource_8 extends _i1.SmartFake +class _FakeObjectAccessControlsResource_10 extends _i1.SmartFake implements _i4.ObjectAccessControlsResource { - _FakeObjectAccessControlsResource_8( + _FakeObjectAccessControlsResource_10( Object parent, Invocation parentInvocation, ) : super( @@ -126,9 +148,9 @@ class _FakeObjectAccessControlsResource_8 extends _i1.SmartFake ); } -class _FakeObjectsResource_9 extends _i1.SmartFake +class _FakeObjectsResource_11 extends _i1.SmartFake implements _i4.ObjectsResource { - _FakeObjectsResource_9( + _FakeObjectsResource_11( Object parent, Invocation parentInvocation, ) : super( @@ -137,9 +159,20 @@ class _FakeObjectsResource_9 extends _i1.SmartFake ); } -class _FakeProjectsResource_10 extends _i1.SmartFake +class _FakeOperationsResource_12 extends _i1.SmartFake + implements _i4.OperationsResource { + _FakeOperationsResource_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeProjectsResource_13 extends _i1.SmartFake implements _i4.ProjectsResource { - _FakeProjectsResource_10( + _FakeProjectsResource_13( Object parent, Invocation parentInvocation, ) : super( @@ -148,8 +181,9 @@ class _FakeProjectsResource_10 extends _i1.SmartFake ); } -class _FakeObject_11 extends _i1.SmartFake implements _i4.Object { - _FakeObject_11( +class _FakeGoogleLongrunningOperation_14 extends _i1.SmartFake + implements _i4.GoogleLongrunningOperation { + _FakeGoogleLongrunningOperation_14( Object parent, Invocation parentInvocation, ) : super( @@ -158,8 +192,8 @@ class _FakeObject_11 extends _i1.SmartFake implements _i4.Object { ); } -class _FakeObject_12 extends _i1.SmartFake implements Object { - _FakeObject_12( +class _FakeObject_15 extends _i1.SmartFake implements _i4.Object { + _FakeObject_15( Object parent, Invocation parentInvocation, ) : super( @@ -168,8 +202,8 @@ class _FakeObject_12 extends _i1.SmartFake implements Object { ); } -class _FakePolicy_13 extends _i1.SmartFake implements _i4.Policy { - _FakePolicy_13( +class _FakeObject_16 extends _i1.SmartFake implements Object { + _FakeObject_16( Object parent, Invocation parentInvocation, ) : super( @@ -178,8 +212,8 @@ class _FakePolicy_13 extends _i1.SmartFake implements _i4.Policy { ); } -class _FakeObjects_14 extends _i1.SmartFake implements _i4.Objects { - _FakeObjects_14( +class _FakePolicy_17 extends _i1.SmartFake implements _i4.Policy { + _FakePolicy_17( Object parent, Invocation parentInvocation, ) : super( @@ -188,9 +222,19 @@ class _FakeObjects_14 extends _i1.SmartFake implements _i4.Objects { ); } -class _FakeRewriteResponse_15 extends _i1.SmartFake +class _FakeObjects_18 extends _i1.SmartFake implements _i4.Objects { + _FakeObjects_18( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeRewriteResponse_19 extends _i1.SmartFake implements _i4.RewriteResponse { - _FakeRewriteResponse_15( + _FakeRewriteResponse_19( Object parent, Invocation parentInvocation, ) : super( @@ -199,9 +243,9 @@ class _FakeRewriteResponse_15 extends _i1.SmartFake ); } -class _FakeTestIamPermissionsResponse_16 extends _i1.SmartFake +class _FakeTestIamPermissionsResponse_20 extends _i1.SmartFake implements _i4.TestIamPermissionsResponse { - _FakeTestIamPermissionsResponse_16( + _FakeTestIamPermissionsResponse_20( Object parent, Invocation parentInvocation, ) : super( @@ -210,8 +254,8 @@ class _FakeTestIamPermissionsResponse_16 extends _i1.SmartFake ); } -class _FakeChannel_17 extends _i1.SmartFake implements _i4.Channel { - _FakeChannel_17( +class _FakeChannel_21 extends _i1.SmartFake implements _i4.Channel { + _FakeChannel_21( Object parent, Invocation parentInvocation, ) : super( @@ -473,11 +517,20 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { _i1.throwOnMissingStub(this); } + @override + _i4.AnywhereCacheResource get anywhereCache => (super.noSuchMethod( + Invocation.getter(#anywhereCache), + returnValue: _FakeAnywhereCacheResource_3( + this, + Invocation.getter(#anywhereCache), + ), + ) as _i4.AnywhereCacheResource); + @override _i4.BucketAccessControlsResource get bucketAccessControls => (super.noSuchMethod( Invocation.getter(#bucketAccessControls), - returnValue: _FakeBucketAccessControlsResource_3( + returnValue: _FakeBucketAccessControlsResource_4( this, Invocation.getter(#bucketAccessControls), ), @@ -486,7 +539,7 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { @override _i4.BucketsResource get buckets => (super.noSuchMethod( Invocation.getter(#buckets), - returnValue: _FakeBucketsResource_4( + returnValue: _FakeBucketsResource_5( this, Invocation.getter(#buckets), ), @@ -495,7 +548,7 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { @override _i4.ChannelsResource get channels => (super.noSuchMethod( Invocation.getter(#channels), - returnValue: _FakeChannelsResource_5( + returnValue: _FakeChannelsResource_6( this, Invocation.getter(#channels), ), @@ -505,16 +558,25 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { _i4.DefaultObjectAccessControlsResource get defaultObjectAccessControls => (super.noSuchMethod( Invocation.getter(#defaultObjectAccessControls), - returnValue: _FakeDefaultObjectAccessControlsResource_6( + returnValue: _FakeDefaultObjectAccessControlsResource_7( this, Invocation.getter(#defaultObjectAccessControls), ), ) as _i4.DefaultObjectAccessControlsResource); + @override + _i4.ManagedFoldersResource get managedFolders => (super.noSuchMethod( + Invocation.getter(#managedFolders), + returnValue: _FakeManagedFoldersResource_8( + this, + Invocation.getter(#managedFolders), + ), + ) as _i4.ManagedFoldersResource); + @override _i4.NotificationsResource get notifications => (super.noSuchMethod( Invocation.getter(#notifications), - returnValue: _FakeNotificationsResource_7( + returnValue: _FakeNotificationsResource_9( this, Invocation.getter(#notifications), ), @@ -524,7 +586,7 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { _i4.ObjectAccessControlsResource get objectAccessControls => (super.noSuchMethod( Invocation.getter(#objectAccessControls), - returnValue: _FakeObjectAccessControlsResource_8( + returnValue: _FakeObjectAccessControlsResource_10( this, Invocation.getter(#objectAccessControls), ), @@ -533,16 +595,25 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { @override _i4.ObjectsResource get objects => (super.noSuchMethod( Invocation.getter(#objects), - returnValue: _FakeObjectsResource_9( + returnValue: _FakeObjectsResource_11( this, Invocation.getter(#objects), ), ) as _i4.ObjectsResource); + @override + _i4.OperationsResource get operations => (super.noSuchMethod( + Invocation.getter(#operations), + returnValue: _FakeOperationsResource_12( + this, + Invocation.getter(#operations), + ), + ) as _i4.OperationsResource); + @override _i4.ProjectsResource get projects => (super.noSuchMethod( Invocation.getter(#projects), - returnValue: _FakeProjectsResource_10( + returnValue: _FakeProjectsResource_13( this, Invocation.getter(#projects), ), @@ -553,6 +624,48 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { /// /// See the documentation for Mockito's code generation for more information. class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { + @override + _i6.Future<_i4.GoogleLongrunningOperation> bulkRestore( + _i4.BulkRestoreObjectsRequest? request, + String? bucket, { + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #bulkRestore, + [ + request, + bucket, + ], + {#$fields: $fields}, + ), + returnValue: _i6.Future<_i4.GoogleLongrunningOperation>.value( + _FakeGoogleLongrunningOperation_14( + this, + Invocation.method( + #bulkRestore, + [ + request, + bucket, + ], + {#$fields: $fields}, + ), + )), + returnValueForMissingStub: + _i6.Future<_i4.GoogleLongrunningOperation>.value( + _FakeGoogleLongrunningOperation_14( + this, + Invocation.method( + #bulkRestore, + [ + request, + bucket, + ], + {#$fields: $fields}, + ), + )), + ) as _i6.Future<_i4.GoogleLongrunningOperation>); + @override _i6.Future<_i4.Object> compose( _i4.ComposeRequest? request, @@ -562,7 +675,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifGenerationMatch, String? ifMetagenerationMatch, String? kmsKeyName, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -579,12 +691,11 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationMatch: ifGenerationMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #kmsKeyName: kmsKeyName, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #compose, @@ -598,13 +709,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationMatch: ifGenerationMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #kmsKeyName: kmsKeyName, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #compose, @@ -618,7 +728,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationMatch: ifGenerationMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #kmsKeyName: kmsKeyName, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -644,7 +753,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifSourceMetagenerationMatch, String? ifSourceMetagenerationNotMatch, String? projection, - String? provisionalUserProject, String? sourceGeneration, String? userProject, String? $fields, @@ -671,13 +779,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, #sourceGeneration: sourceGeneration, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #copy, @@ -700,14 +807,13 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, #sourceGeneration: sourceGeneration, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #copy, @@ -730,7 +836,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, #sourceGeneration: sourceGeneration, #userProject: userProject, #$fields: $fields, @@ -748,7 +853,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifGenerationNotMatch, String? ifMetagenerationMatch, String? ifMetagenerationNotMatch, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -765,7 +869,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -784,7 +887,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifMetagenerationMatch, String? ifMetagenerationNotMatch, String? projection, - String? provisionalUserProject, + bool? softDeleted, String? userProject, String? $fields, _i10.DownloadOptions? downloadOptions = _i10.DownloadOptions.metadata, @@ -803,13 +906,13 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #userProject: userProject, #$fields: $fields, #downloadOptions: downloadOptions, }, ), - returnValue: _i6.Future.value(_FakeObject_12( + returnValue: _i6.Future.value(_FakeObject_16( this, Invocation.method( #get, @@ -824,14 +927,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #userProject: userProject, #$fields: $fields, #downloadOptions: downloadOptions, }, ), )), - returnValueForMissingStub: _i6.Future.value(_FakeObject_12( + returnValueForMissingStub: _i6.Future.value(_FakeObject_16( this, Invocation.method( #get, @@ -846,7 +949,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #userProject: userProject, #$fields: $fields, #downloadOptions: downloadOptions, @@ -860,7 +963,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? bucket, String? object, { String? generation, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -873,12 +975,11 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_17( this, Invocation.method( #getIamPolicy, @@ -888,13 +989,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_17( this, Invocation.method( #getIamPolicy, @@ -904,7 +1004,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -925,7 +1024,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? name, String? predefinedAcl, String? projection, - String? provisionalUserProject, String? userProject, String? $fields, _i10.UploadOptions? uploadOptions = _i10.UploadOptions.defaultOptions, @@ -948,14 +1046,13 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #name: name, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, #uploadOptions: uploadOptions, #uploadMedia: uploadMedia, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #insert, @@ -973,7 +1070,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #name: name, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, #uploadOptions: uploadOptions, @@ -981,7 +1077,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #insert, @@ -999,7 +1095,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #name: name, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, #uploadOptions: uploadOptions, @@ -1014,12 +1109,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? bucket, { String? delimiter, String? endOffset, + bool? includeFoldersAsPrefixes, bool? includeTrailingDelimiter, + String? matchGlob, int? maxResults, String? pageToken, String? prefix, String? projection, - String? provisionalUserProject, + bool? softDeleted, String? startOffset, String? userProject, bool? versions, @@ -1032,19 +1129,21 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { { #delimiter: delimiter, #endOffset: endOffset, + #includeFoldersAsPrefixes: includeFoldersAsPrefixes, #includeTrailingDelimiter: includeTrailingDelimiter, + #matchGlob: matchGlob, #maxResults: maxResults, #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #startOffset: startOffset, #userProject: userProject, #versions: versions, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Objects>.value(_FakeObjects_14( + returnValue: _i6.Future<_i4.Objects>.value(_FakeObjects_18( this, Invocation.method( #list, @@ -1052,12 +1151,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { { #delimiter: delimiter, #endOffset: endOffset, + #includeFoldersAsPrefixes: includeFoldersAsPrefixes, #includeTrailingDelimiter: includeTrailingDelimiter, + #matchGlob: matchGlob, #maxResults: maxResults, #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #startOffset: startOffset, #userProject: userProject, #versions: versions, @@ -1066,7 +1167,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), returnValueForMissingStub: - _i6.Future<_i4.Objects>.value(_FakeObjects_14( + _i6.Future<_i4.Objects>.value(_FakeObjects_18( this, Invocation.method( #list, @@ -1074,12 +1175,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { { #delimiter: delimiter, #endOffset: endOffset, + #includeFoldersAsPrefixes: includeFoldersAsPrefixes, #includeTrailingDelimiter: includeTrailingDelimiter, + #matchGlob: matchGlob, #maxResults: maxResults, #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #startOffset: startOffset, #userProject: userProject, #versions: versions, @@ -1099,9 +1202,9 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifGenerationNotMatch, String? ifMetagenerationMatch, String? ifMetagenerationNotMatch, + bool? overrideUnlockedRetention, String? predefinedAcl, String? projection, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -1119,14 +1222,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #patch, @@ -1141,15 +1244,15 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #patch, @@ -1164,9 +1267,90 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Object>); + + @override + _i6.Future<_i4.Object> restore( + _i4.Object? request, + String? bucket, + String? object, + String? generation, { + bool? copySourceAcl, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? projection, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #restore, + [ + request, + bucket, + object, + generation, + ], + { + #copySourceAcl: copySourceAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( + this, + Invocation.method( + #restore, + [ + request, + bucket, + object, + generation, + ], + { + #copySourceAcl: copySourceAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( + this, + Invocation.method( + #restore, + [ + request, + bucket, + object, + generation, + ], + { + #copySourceAcl: copySourceAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, #userProject: userProject, #$fields: $fields, }, @@ -1193,7 +1377,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifSourceMetagenerationNotMatch, String? maxBytesRewrittenPerCall, String? projection, - String? provisionalUserProject, String? rewriteToken, String? sourceGeneration, String? userProject, @@ -1222,7 +1405,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, #projection: projection, - #provisionalUserProject: provisionalUserProject, #rewriteToken: rewriteToken, #sourceGeneration: sourceGeneration, #userProject: userProject, @@ -1230,7 +1412,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { }, ), returnValue: - _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_15( + _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_19( this, Invocation.method( #rewrite, @@ -1254,7 +1436,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, #projection: projection, - #provisionalUserProject: provisionalUserProject, #rewriteToken: rewriteToken, #sourceGeneration: sourceGeneration, #userProject: userProject, @@ -1263,7 +1444,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), returnValueForMissingStub: - _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_15( + _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_19( this, Invocation.method( #rewrite, @@ -1287,7 +1468,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, #projection: projection, - #provisionalUserProject: provisionalUserProject, #rewriteToken: rewriteToken, #sourceGeneration: sourceGeneration, #userProject: userProject, @@ -1303,7 +1483,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? bucket, String? object, { String? generation, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -1317,12 +1496,11 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_17( this, Invocation.method( #setIamPolicy, @@ -1333,13 +1511,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_17( this, Invocation.method( #setIamPolicy, @@ -1350,7 +1527,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -1364,7 +1540,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? object, List? permissions, { String? generation, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -1378,13 +1553,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), returnValue: _i6.Future<_i4.TestIamPermissionsResponse>.value( - _FakeTestIamPermissionsResponse_16( + _FakeTestIamPermissionsResponse_20( this, Invocation.method( #testIamPermissions, @@ -1395,7 +1569,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -1403,7 +1576,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { )), returnValueForMissingStub: _i6.Future<_i4.TestIamPermissionsResponse>.value( - _FakeTestIamPermissionsResponse_16( + _FakeTestIamPermissionsResponse_20( this, Invocation.method( #testIamPermissions, @@ -1414,7 +1587,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -1432,9 +1604,9 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifGenerationNotMatch, String? ifMetagenerationMatch, String? ifMetagenerationNotMatch, + bool? overrideUnlockedRetention, String? predefinedAcl, String? projection, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -1452,14 +1624,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #update, @@ -1474,15 +1646,15 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #update, @@ -1497,9 +1669,9 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -1518,7 +1690,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? pageToken, String? prefix, String? projection, - String? provisionalUserProject, String? startOffset, String? userProject, bool? versions, @@ -1539,14 +1710,13 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, #startOffset: startOffset, #userProject: userProject, #versions: versions, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Channel>.value(_FakeChannel_17( + returnValue: _i6.Future<_i4.Channel>.value(_FakeChannel_21( this, Invocation.method( #watchAll, @@ -1562,7 +1732,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, #startOffset: startOffset, #userProject: userProject, #versions: versions, @@ -1571,7 +1740,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), returnValueForMissingStub: - _i6.Future<_i4.Channel>.value(_FakeChannel_17( + _i6.Future<_i4.Channel>.value(_FakeChannel_21( this, Invocation.method( #watchAll, @@ -1587,7 +1756,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, #startOffset: startOffset, #userProject: userProject, #versions: versions, diff --git a/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md index 28955127a78e..58a970e78f7d 100644 --- a/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md +++ b/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.10.2 + +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. + ## 0.10.1+2 * Fixes "width and height missing" warning on web. diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml index 2132641ca791..06625c07fbb7 100644 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml @@ -3,8 +3,8 @@ description: "Demonstrates how to use the pointer_interceptor_web plugin." publish_to: 'none' environment: - sdk: ^3.2.0 - flutter: '>=3.16.0' + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: cupertino_icons: ^1.0.2 @@ -13,7 +13,7 @@ dependencies: pointer_interceptor_platform_interface: ^0.10.0 pointer_interceptor_web: path: ../../pointer_interceptor_web - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml index ff1f0747d9d5..83e41de9e23e 100644 --- a/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml +++ b/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml @@ -2,11 +2,11 @@ name: pointer_interceptor_web description: Web implementation of the pointer_interceptor plugin. repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apointer_interceptor -version: 0.10.1+2 +version: 0.10.2 environment: - sdk: ^3.2.0 - flutter: '>=3.16.0' + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -23,7 +23,7 @@ dependencies: sdk: flutter plugin_platform_interface: ^2.1.7 pointer_interceptor_platform_interface: ^0.10.0 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/shared_preferences/shared_preferences_web/CHANGELOG.md b/packages/shared_preferences/shared_preferences_web/CHANGELOG.md index 5f5d8c246cd6..5cb8dc3b6120 100644 --- a/packages/shared_preferences/shared_preferences_web/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.3.0 + +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. + ## 2.2.2 * Updates minimum supported SDK version to Dart 3.2. diff --git a/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart b/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart index 9f0faae41367..0238ba578a45 100644 --- a/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart +++ b/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart @@ -9,8 +9,7 @@ import 'package:shared_preferences_platform_interface/shared_preferences_platfor import 'package:shared_preferences_platform_interface/types.dart'; import 'package:shared_preferences_web/shared_preferences_web.dart'; import 'package:shared_preferences_web/src/keys_extension.dart'; - -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/shared_preferences/shared_preferences_web/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_web/example/pubspec.yaml index bf6ca2a883df..44672c4e6425 100644 --- a/packages/shared_preferences/shared_preferences_web/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_web/example/pubspec.yaml @@ -11,11 +11,10 @@ dependencies: shared_preferences_platform_interface: ^2.3.0 shared_preferences_web: path: ../ - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: sdk: flutter integration_test: sdk: flutter - js: ^0.6.3 diff --git a/packages/shared_preferences/shared_preferences_web/pubspec.yaml b/packages/shared_preferences/shared_preferences_web/pubspec.yaml index ceb1dfebcf7a..1278a54a3e51 100644 --- a/packages/shared_preferences/shared_preferences_web/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_web/pubspec.yaml @@ -2,11 +2,11 @@ name: shared_preferences_web description: Web platform implementation of shared_preferences repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22 -version: 2.2.2 +version: 2.3.0 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -22,7 +22,7 @@ dependencies: flutter_web_plugins: sdk: flutter shared_preferences_platform_interface: ^2.3.0 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index 641b48d27cf2..5e3d6d42b35e 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.3.0 + +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. + ## 2.2.3 * Fixes new lint warnings. diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart b/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart index 528cff32c0e5..9cd76d03c80c 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_util'; +import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; import 'dart:ui_web' as ui_web; import 'package:flutter/widgets.dart'; @@ -10,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:url_launcher_platform_interface/link.dart'; import 'package:url_launcher_web/src/link.dart'; -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -177,7 +178,7 @@ html.Element _findSingleAnchor() { html.NodeList anchors = html.document.querySelectorAll('a'); for (int i = 0; i < anchors.length; i++) { final html.Element anchor = anchors.item(i)! as html.Element; - if (hasProperty(anchor, linkViewIdProperty)) { + if (anchor.hasProperty(linkViewIdProperty.toJS).toDart) { foundAnchors.add(anchor); } } @@ -189,7 +190,7 @@ html.Element _findSingleAnchor() { anchors = shadowRoot.querySelectorAll('a'); for (int i = 0; i < anchors.length; i++) { final html.Element anchor = anchors.item(i)! as html.Element; - if (hasProperty(anchor, linkViewIdProperty)) { + if (anchor.hasProperty(linkViewIdProperty.toJS).toDart) { foundAnchors.add(anchor); } } diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart index ec01d28163aa..b75903873467 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart @@ -3,14 +3,13 @@ // found in the LICENSE file. import 'dart:js_interop'; -import 'dart:js_util'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:mockito/mockito.dart' show Mock, any, verify, when; import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; import 'package:url_launcher_web/url_launcher_web.dart'; -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; abstract class MyWindow { html.Window? open(Object? a, Object? b, Object? c); @@ -33,6 +32,7 @@ void main() { group('UrlLauncherPlugin', () { late MockWindow mockWindow; late MockNavigator mockNavigator; + late html.Window jsMockWindow; late UrlLauncherPlugin plugin; @@ -40,10 +40,9 @@ void main() { mockWindow = MockWindow(); mockNavigator = MockNavigator(); - final html.Window jsMockWindow = - createDartExport(mockWindow) as html.Window; + jsMockWindow = createJSInteropWrapper(mockWindow) as html.Window; final html.Navigator jsMockNavigator = - createDartExport(mockNavigator) as html.Navigator; + createJSInteropWrapper(mockNavigator) as html.Navigator; when(mockWindow.navigator).thenReturn(jsMockNavigator); @@ -53,7 +52,7 @@ void main() { when(mockNavigator.userAgent).thenReturn( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'); - plugin = UrlLauncherPlugin(debugWindow: mockWindow as html.Window); + plugin = UrlLauncherPlugin(debugWindow: jsMockWindow); }); group('canLaunch', () { @@ -185,7 +184,7 @@ void main() { when(mockNavigator.userAgent).thenReturn( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Safari/605.1.15'); // Recreate the plugin, so it grabs the overrides from this group - plugin = UrlLauncherPlugin(debugWindow: mockWindow as html.Window); + plugin = UrlLauncherPlugin(debugWindow: jsMockWindow); }); testWidgets('http urls should be launched in a new window', diff --git a/packages/url_launcher/url_launcher_web/example/pubspec.yaml b/packages/url_launcher/url_launcher_web/example/pubspec.yaml index eca281ef0a2f..c87511dd84b8 100644 --- a/packages/url_launcher/url_launcher_web/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: regular_integration_tests publish_to: none environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: flutter: @@ -18,4 +18,4 @@ dev_dependencies: url_launcher_platform_interface: ^2.2.0 url_launcher_web: path: ../ - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 diff --git a/packages/url_launcher/url_launcher_web/lib/src/link.dart b/packages/url_launcher/url_launcher_web/lib/src/link.dart index b2217fafb805..558f3a135a27 100644 --- a/packages/url_launcher/url_launcher_web/lib/src/link.dart +++ b/packages/url_launcher/url_launcher_web/lib/src/link.dart @@ -3,7 +3,8 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:js_util'; +import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; import 'dart:ui_web' as ui_web; import 'package:flutter/foundation.dart'; @@ -12,7 +13,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:url_launcher_platform_interface/link.dart'; -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; /// The unique identifier for the view type to be used for link platform views. const String linkViewType = '__url_launcher::link'; @@ -172,7 +173,7 @@ class LinkViewController extends PlatformViewController { Future _initialize() async { _element = html.document.createElement('a') as html.HTMLElement; - setProperty(_element, linkViewIdProperty, viewId); + _element[linkViewIdProperty] = viewId.toJS; _element.style ..opacity = '0' ..display = 'block' @@ -283,11 +284,7 @@ class LinkViewController extends PlatformViewController { int? getViewIdFromTarget(html.Event event) { final html.Element? linkElement = getLinkElementFromTarget(event); if (linkElement != null) { - // TODO(stuartmorgan): Remove this ignore (and change to getProperty) - // once the templated version is available on stable. On master (2.8) this - // is already not necessary. - // ignore: return_of_invalid_type - return getProperty(linkElement, linkViewIdProperty); + return linkElement.getProperty(linkViewIdProperty.toJS).toDartInt; } return null; } @@ -316,5 +313,5 @@ html.Element? getLinkElementFromTarget(html.Event event) { bool isLinkElement(html.Element? element) { return element != null && element.tagName == 'A' && - hasProperty(element, linkViewIdProperty); + element.hasProperty(linkViewIdProperty.toJS).toDart; } diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index 6c89bba58091..35154b5a6d2b 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -2,11 +2,11 @@ name: url_launcher_web description: Web platform implementation of url_launcher repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 2.2.3 +version: 2.3.0 environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -22,7 +22,7 @@ dependencies: flutter_web_plugins: sdk: flutter url_launcher_platform_interface: ^2.2.0 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/video_player/video_player_web/CHANGELOG.md b/packages/video_player/video_player_web/CHANGELOG.md index 4ce1c96de5d8..8e9e9f21f736 100644 --- a/packages/video_player/video_player_web/CHANGELOG.md +++ b/packages/video_player/video_player_web/CHANGELOG.md @@ -1,6 +1,6 @@ -## NEXT +## 2.2.0 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. ## 2.1.3 diff --git a/packages/video_player/video_player_web/example/integration_test/utils.dart b/packages/video_player/video_player_web/example/integration_test/utils.dart index 6be5b5abcc75..75af525d4103 100644 --- a/packages/video_player/video_player_web/example/integration_test/utils.dart +++ b/packages/video_player/video_player_web/example/integration_test/utils.dart @@ -2,12 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@JS() -library integration_test_utils; - -import 'dart:html'; - -import 'package:js/js.dart'; +import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; +import 'package:web/web.dart' as web; // Returns the URL to load an asset from this example app as a network source. // @@ -22,35 +19,40 @@ String getUrlForAssetAsNetworkSource(String assetKey) { '?raw=true'; } -@JS() -@anonymous -class _Descriptor { +extension type Descriptor._(JSObject _) implements JSObject { // May also contain "configurable" and "enumerable" bools. // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description - external factory _Descriptor({ + external factory Descriptor({ // bool configurable, // bool enumerable, - bool writable, - Object value, + JSBoolean writable, + JSAny value, }); } -@JS('Object.defineProperty') -external void _defineProperty( +void _defineProperty( Object object, String property, - _Descriptor description, -); + Descriptor description, +) { + (globalContext['Object'] as JSObject?)?.callMethod( + 'defineProperty'.toJS, + object as JSObject, + property.toJS, + description, + ); +} /// Forces a VideoElement to report "Infinity" duration. /// /// Uses JS Object.defineProperty to set the value of a readonly property. -void setInfinityDuration(VideoElement element) { +void setInfinityDuration(Object videoElement) { + assert(videoElement is web.HTMLVideoElement); _defineProperty( - element, + videoElement, 'duration', - _Descriptor( - writable: true, - value: double.infinity, + Descriptor( + writable: true.toJS, + value: double.infinity.toJS, )); } diff --git a/packages/video_player/video_player_web/example/pubspec.yaml b/packages/video_player/video_player_web/example/pubspec.yaml index 866d089f8687..bd2f3ba48788 100644 --- a/packages/video_player/video_player_web/example/pubspec.yaml +++ b/packages/video_player/video_player_web/example/pubspec.yaml @@ -2,16 +2,16 @@ name: video_player_for_web_integration_tests publish_to: none environment: - sdk: ^3.1.0 - flutter: ">=3.13.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: flutter: sdk: flutter - js: ^0.6.0 - video_player_platform_interface: ">=6.1.0 <7.0.0" + video_player_platform_interface: ^6.1.0 video_player_web: path: ../ + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/video_player/video_player_web/pubspec.yaml b/packages/video_player/video_player_web/pubspec.yaml index 81ad0e6d1bf7..0cb69f88b743 100644 --- a/packages/video_player/video_player_web/pubspec.yaml +++ b/packages/video_player/video_player_web/pubspec.yaml @@ -2,11 +2,11 @@ name: video_player_web description: Web platform implementation of video_player. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.1.3 +version: 2.2.0 environment: - sdk: ">=3.1.0 <4.0.0" - flutter: ">=3.13.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: diff --git a/packages/web_benchmarks/CHANGELOG.md b/packages/web_benchmarks/CHANGELOG.md index 98e9f675b1fd..c4b3cf125ad2 100644 --- a/packages/web_benchmarks/CHANGELOG.md +++ b/packages/web_benchmarks/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 1.2.0 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates to web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. ## 1.1.1 diff --git a/packages/web_benchmarks/lib/client.dart b/packages/web_benchmarks/lib/client.dart index baaab84fe504..d1c52d775fb8 100644 --- a/packages/web_benchmarks/lib/client.dart +++ b/packages/web_benchmarks/lib/client.dart @@ -7,7 +7,7 @@ import 'dart:convert' show json; import 'dart:js_interop'; import 'dart:math' as math; -import 'package:web/helpers.dart'; +import 'package:web/web.dart'; import 'src/common.dart'; import 'src/recorder.dart'; @@ -157,9 +157,7 @@ void _printResultsToScreen(Profile profile) { profile.scoreData.forEach((String scoreKey, Timeseries timeseries) { body.appendHtml('

$scoreKey

'); body.appendHtml('
${timeseries.computeStats()}
'); - // TODO(kevmoo): remove `NodeGlue` cast when we no longer need to support - // pkg:web 0.3.0 - NodeGlue(body).append(TimeseriesVisualization(timeseries).render()); + body.appendChild(TimeseriesVisualization(timeseries).render()); }); } @@ -168,7 +166,7 @@ class TimeseriesVisualization { /// Creates a visualization for a [Timeseries]. TimeseriesVisualization(this._timeseries) { _stats = _timeseries.computeStats(); - _canvas = CanvasElement(); + _canvas = HTMLCanvasElement(); _screenWidth = window.screen.width; _canvas.width = _screenWidth; _canvas.height = (_kCanvasHeight * window.devicePixelRatio).round(); @@ -192,7 +190,7 @@ class TimeseriesVisualization { final Timeseries _timeseries; late TimeseriesStats _stats; - late CanvasElement _canvas; + late HTMLCanvasElement _canvas; late CanvasRenderingContext2D _ctx; late int _screenWidth; @@ -215,7 +213,7 @@ class TimeseriesVisualization { } /// Renders the timeseries into a `` and returns the canvas element. - CanvasElement render() { + HTMLCanvasElement render() { _ctx.translate(0, _kCanvasHeight * window.devicePixelRatio); _ctx.scale(1, -window.devicePixelRatio); diff --git a/packages/web_benchmarks/lib/src/recorder.dart b/packages/web_benchmarks/lib/src/recorder.dart index 49707b8c4b63..7488c44c2c41 100644 --- a/packages/web_benchmarks/lib/src/recorder.dart +++ b/packages/web_benchmarks/lib/src/recorder.dart @@ -15,7 +15,7 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart'; -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; import 'common.dart'; diff --git a/packages/web_benchmarks/pubspec.yaml b/packages/web_benchmarks/pubspec.yaml index aa89736869cb..584e69706ee3 100644 --- a/packages/web_benchmarks/pubspec.yaml +++ b/packages/web_benchmarks/pubspec.yaml @@ -2,11 +2,11 @@ name: web_benchmarks description: A benchmark harness for performance-testing Flutter apps in Chrome. repository: https://github.com/flutter/packages/tree/main/packages/web_benchmarks issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+web_benchmarks%22 -version: 1.1.1 +version: 1.2.0 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: collection: ^1.18.0 @@ -14,6 +14,7 @@ dependencies: sdk: flutter flutter_test: sdk: flutter + http: ^1.0.0 logging: ^1.0.2 meta: ^1.7.0 path: ^1.8.0 @@ -21,7 +22,7 @@ dependencies: shelf: ^1.2.0 shelf_static: ^1.1.0 test: ^1.19.5 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 webkit_inspection_protocol: ^1.0.0 topics: