Skip to content

Commit 48048f6

Browse files
authored
[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: #5791
1 parent b21dce5 commit 48048f6

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

packages/google_sign_in/google_sign_in_web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.12.4
2+
3+
* Updates dependencies to `web: ^0.5.0` and `google_identity_services_web: ^0.3.1`.
4+
15
## 0.12.3+3
26

37
* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`.

packages/google_sign_in/google_sign_in_web/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
cupertino_icons: ^1.0.2
1010
flutter:
1111
sdk: flutter
12-
google_identity_services_web: ^0.3.0
12+
google_identity_services_web: ^0.3.1
1313
google_sign_in_platform_interface: ^2.4.0
1414
google_sign_in_web:
1515
path: ../
@@ -22,7 +22,7 @@ dev_dependencies:
2222
integration_test:
2323
sdk: flutter
2424
mockito: 5.4.4
25-
web: ">=0.3.0 <0.6.0"
25+
web: ^0.5.0
2626

2727
flutter:
2828
uses-material-design: true

packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,10 @@ class _FlexHtmlElementView extends State<FlexHtmlElementView> {
7373

7474
/// The function called whenever an observed resize occurs.
7575
void _onResizeEntries(
76-
// TODO(srujzs): Remove once typed JSArrays (JSArray<T>) get to `stable`.
77-
// ignore: always_specify_types
78-
JSArray resizes,
76+
JSArray<web.ResizeObserverEntry> resizes,
7977
web.ResizeObserver observer,
8078
) {
81-
final web.DOMRectReadOnly rect =
82-
resizes.toDart.cast<web.ResizeObserverEntry>().last.contentRect;
79+
final web.DOMRectReadOnly rect = resizes.toDart.last.contentRect;
8380
if (rect.width > 0 && rect.height > 0) {
8481
_doResize(Size(rect.width.toDouble(), rect.height.toDouble()));
8582
}
@@ -90,14 +87,10 @@ class _FlexHtmlElementView extends State<FlexHtmlElementView> {
9087
/// When mutations are received, this function attaches a Resize Observer to
9188
/// the first child of the mutation, which will drive
9289
void _onMutationRecords(
93-
// TODO(srujzs): Remove once typed JSArrays (JSArray<T>) get to `stable`.
94-
// ignore: always_specify_types
95-
JSArray mutations,
90+
JSArray<web.MutationRecord> mutations,
9691
web.MutationObserver observer,
9792
) {
98-
mutations.toDart
99-
.cast<web.MutationRecord>()
100-
.forEach((web.MutationRecord mutation) {
93+
for (final web.MutationRecord mutation in mutations.toDart) {
10194
if (mutation.addedNodes.length > 0) {
10295
final web.Element? element = _locateSizeProvider(mutation.addedNodes);
10396
if (element != null) {
@@ -108,7 +101,7 @@ class _FlexHtmlElementView extends State<FlexHtmlElementView> {
108101
return;
109102
}
110103
}
111-
});
104+
}
112105
}
113106

114107
/// Registers a MutationObserver on the root element of the HtmlElementView.

packages/google_sign_in/google_sign_in_web/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system
33
for signing in with a Google account on Android, iOS and Web.
44
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
6-
version: 0.12.3+3
6+
version: 0.12.4
77

88
environment:
99
sdk: ^3.3.0
@@ -22,10 +22,10 @@ dependencies:
2222
sdk: flutter
2323
flutter_web_plugins:
2424
sdk: flutter
25-
google_identity_services_web: ^0.3.0
25+
google_identity_services_web: ^0.3.1
2626
google_sign_in_platform_interface: ^2.4.0
2727
http: ">=0.13.0 <2.0.0"
28-
web: ">=0.3.0 <0.6.0" # because google_identity_services
28+
web: ^0.5.0
2929

3030
dev_dependencies:
3131
flutter_test:

0 commit comments

Comments
 (0)