[google_sign_in_web]Fix renderButton stuck on "Getting ready" for Web (Future<void> issue)#11081
Conversation
There was a problem hiding this comment.
Code Review
This pull request addresses a bug in renderButton on the web, where the widget would remain in a "Getting ready" state. The change correctly updates the condition within the FutureBuilder to check snapshot.connectionState == ConnectionState.done instead of snapshot.hasData, which is the proper way to handle a Future<void>. I've included a suggestion to enhance robustness by also handling potential error states within the FutureBuilder.
|
The current published version is 1.1.1. |
This needs the changelog and version steps in the checklist as part of the PR for that to happen. |
mdebbar
left a comment
There was a problem hiding this comment.
Thanks for the quick fix @puneetkukreja98!
In addition to what @stuartmorgan-g said, would you mind also adding a test to protect us from the same issue in the future?
|
Thanks for the review @stuartmorgan-g & @mdebbar . |
07d7191 to
af83e31
Compare
|
Hi @mdebbar , this is ready for your review whenever you have a moment. Thanks! |
|
Marking as draft for now, since per discussion today this needs to incorporate a revert of the revert. |
af83e31 to
678f033
Compare
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where the renderButton on web would remain stuck in a "Getting ready" state. This is fixed by changing the FutureBuilder condition from checking snapshot.hasData to snapshot.connectionState == ConnectionState.done, which correctly handles a Future<void>. Additionally, the pull request refactors the plugin initialization logic to prevent init() from being called multiple times, introducing a check that throws a StateError on subsequent calls. This is accompanied by related refactoring of internal state management for initialization and the GIS client. New integration tests have been added to cover both the renderButton fix and the new init() behavior. I have one suggestion to improve error handling during initialization.
fd85c25 to
0925a85
Compare
|
@stuartmorgan-g This PR now:
Ready for review. |
…rformed twice on the web Based on the discussion comments I have removed the calles to _initCalled in the google_sign_in_web package **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
0925a85 to
beabfa0
Compare
…y" for Web (Future<void> issue) (flutter/packages#11081)
flutter/packages@91f7c33...0f2eeae 2026-03-16 [email protected] [tool] Add a SwiftPM flag to fetch-deps (flutter/packages#11258) 2026-03-14 [email protected] [various] Remove CocoaPods from examples (flutter/packages#11237) 2026-03-14 [email protected] Roll Flutter from 9e36adb to 732e05d (20 revisions) (flutter/packages#11242) 2026-03-13 [email protected] [go_router] Add `encoder`,`decoder` and `compare` parameters to `TypedQueryParameter` (flutter/packages#11067) 2026-03-13 [email protected] [camera] Remove outdated TODO in camera_controller.dart (flutter/packages#11239) 2026-03-13 [email protected] [google_sign_in_web]Fix renderButton stuck on "Getting ready" for Web (Future<void> issue) (flutter/packages#11081) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This PR addresses a regression introduced after fixing issue #167410.
Previously, issue #167410 was resolved where _initCalled was being executed twice on web. However, after that fix, a new issue surfaced where the render button was not getting rendered properly(flutter/flutter#182633).
The earlier _initCalled fix PR was reverted. As per discussion, this PR now:
This consolidates the required changes in a single PR to maintain correct initialization flow and proper rendering behavior on web.
Fixes: flutter/flutter#167410
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3