Skip to content

Commit

Permalink
[google_sign_in_web] Updates package:web dependency to 0.5.0. (flutte…
Browse files Browse the repository at this point in the history
…r#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: flutter#5791
  • Loading branch information
ditman authored Feb 20, 2024
1 parent b21dce5 commit 48048f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
4 changes: 4 additions & 0 deletions packages/google_sign_in/google_sign_in_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: ../
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,10 @@ class _FlexHtmlElementView extends State<FlexHtmlElementView> {

/// The function called whenever an observed resize occurs.
void _onResizeEntries(
// TODO(srujzs): Remove once typed JSArrays (JSArray<T>) get to `stable`.
// ignore: always_specify_types
JSArray resizes,
JSArray<web.ResizeObserverEntry> resizes,
web.ResizeObserver observer,
) {
final web.DOMRectReadOnly rect =
resizes.toDart.cast<web.ResizeObserverEntry>().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()));
}
Expand All @@ -90,14 +87,10 @@ class _FlexHtmlElementView extends State<FlexHtmlElementView> {
/// 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<T>) get to `stable`.
// ignore: always_specify_types
JSArray mutations,
JSArray<web.MutationRecord> mutations,
web.MutationObserver observer,
) {
mutations.toDart
.cast<web.MutationRecord>()
.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) {
Expand All @@ -108,7 +101,7 @@ class _FlexHtmlElementView extends State<FlexHtmlElementView> {
return;
}
}
});
}
}

/// Registers a MutationObserver on the root element of the HtmlElementView.
Expand Down
6 changes: 3 additions & 3 deletions packages/google_sign_in/google_sign_in_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 48048f6

Please sign in to comment.