From 48048f6bc779d86394397bcdceb1ce345210e27c Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Tue, 20 Feb 2024 15:46:50 -0800 Subject: [PATCH] [google_sign_in_web] Updates package:web dependency to 0.5.0. (#6167) This PR updates `google_sign_in_web` to use package `web: ^0.5.0`. ## Testing Manually verified using the `example/lib/button_tester.dart` app. This should be text exempt? This is a refactor with no semantic change (also, I wouldn't know how to test we're using `package:web` the expected way!) I removed a couple of `//ignore` at least! ## Issues * Fast follow of: https://github.com/flutter/packages/pull/5791 --- .../google_sign_in_web/CHANGELOG.md | 4 ++++ .../google_sign_in_web/example/pubspec.yaml | 4 ++-- .../src/flexible_size_html_element_view.dart | 17 +++++------------ .../google_sign_in_web/pubspec.yaml | 6 +++--- 4 files changed, 14 insertions(+), 17 deletions(-) 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 2c9c5863c8e2..49d02d368bae 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,7 @@ +## 0.12.4 + +* Updates dependencies to `web: ^0.5.0` and `google_identity_services_web: ^0.3.1`. + ## 0.12.3+3 * Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. 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 1c53b0fa93c9..e260814e73bb 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 @@ -9,7 +9,7 @@ dependencies: cupertino_icons: ^1.0.2 flutter: sdk: flutter - google_identity_services_web: ^0.3.0 + google_identity_services_web: ^0.3.1 google_sign_in_platform_interface: ^2.4.0 google_sign_in_web: path: ../ @@ -22,7 +22,7 @@ dev_dependencies: integration_test: sdk: flutter mockito: 5.4.4 - web: ">=0.3.0 <0.6.0" + web: ^0.5.0 flutter: uses-material-design: true diff --git a/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart b/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart index 63acfb84836e..6fa019ed909a 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart @@ -73,13 +73,10 @@ class _FlexHtmlElementView extends State { /// The function called whenever an observed resize occurs. void _onResizeEntries( - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray resizes, + JSArray resizes, web.ResizeObserver observer, ) { - final web.DOMRectReadOnly rect = - resizes.toDart.cast().last.contentRect; + final web.DOMRectReadOnly rect = resizes.toDart.last.contentRect; if (rect.width > 0 && rect.height > 0) { _doResize(Size(rect.width.toDouble(), rect.height.toDouble())); } @@ -90,14 +87,10 @@ class _FlexHtmlElementView extends State { /// When mutations are received, this function attaches a Resize Observer to /// the first child of the mutation, which will drive void _onMutationRecords( - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray mutations, + JSArray mutations, web.MutationObserver observer, ) { - mutations.toDart - .cast() - .forEach((web.MutationRecord mutation) { + for (final web.MutationRecord mutation in mutations.toDart) { if (mutation.addedNodes.length > 0) { final web.Element? element = _locateSizeProvider(mutation.addedNodes); if (element != null) { @@ -108,7 +101,7 @@ class _FlexHtmlElementView extends State { return; } } - }); + } } /// Registers a MutationObserver on the root element of the HtmlElementView. 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 82b9cd3cd289..b7ed804cc930 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -3,7 +3,7 @@ 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+3 +version: 0.12.4 environment: sdk: ^3.3.0 @@ -22,10 +22,10 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - google_identity_services_web: ^0.3.0 + google_identity_services_web: ^0.3.1 google_sign_in_platform_interface: ^2.4.0 http: ">=0.13.0 <2.0.0" - web: ">=0.3.0 <0.6.0" # because google_identity_services + web: ^0.5.0 dev_dependencies: flutter_test: