Skip to content

[google_sign_in_web]Fix renderButton stuck on "Getting ready" for Web (Future<void> issue)#11081

Merged
auto-submit[bot] merged 4 commits intoflutter:mainfrom
puneetkukreja98:fix-render-button-void-future
Mar 13, 2026
Merged

[google_sign_in_web]Fix renderButton stuck on "Getting ready" for Web (Future<void> issue)#11081
auto-submit[bot] merged 4 commits intoflutter:mainfrom
puneetkukreja98:fix-render-button-void-future

Conversation

@puneetkukreja98
Copy link
Contributor

@puneetkukreja98 puneetkukreja98 commented Feb 20, 2026

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:

  1. Cherry-picks the necessary changes from the reverted commit
  2. Incorporates the _initCalled fix
  3. Includes the additional fix to ensure the render button is rendered correctly
  4. Ensures both issues are resolved together without causing regression

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

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-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.

Footnotes

  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. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@puneetkukreja98
Copy link
Contributor Author

The current published version is 1.1.1.
This PR contains a bug fix only, this should be release as a patch version (1.1.2)

@stuartmorgan-g
Copy link
Collaborator

This PR contains a bug fix only, this should be release as a patch version (1.1.2)

This needs the changelog and version steps in the checklist as part of the PR for that to happen.

Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@puneetkukreja98
Copy link
Contributor Author

Thanks for the review @stuartmorgan-g & @mdebbar .
I’ve updated the version and CHANGELOG as requested.
I’ll add a test to prevent this regression and push an update shortly.

@puneetkukreja98 puneetkukreja98 force-pushed the fix-render-button-void-future branch from 07d7191 to af83e31 Compare February 22, 2026 10:31
@puneetkukreja98
Copy link
Contributor Author

Hi @mdebbar , this is ready for your review whenever you have a moment. Thanks!

@stuartmorgan-g stuartmorgan-g marked this pull request as draft February 24, 2026 19:20
@stuartmorgan-g
Copy link
Collaborator

Marking as draft for now, since per discussion today this needs to incorporate a revert of the revert.

@puneetkukreja98 puneetkukreja98 force-pushed the fix-render-button-void-future branch from af83e31 to 678f033 Compare March 3, 2026 11:33
@fluttergithubbot
Copy link

An existing Git SHA, 2c6add7338bbd0f35a4a139ffa48cea45b890b55, was detected, and no actions were taken.

To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with --force) that already was pushed before, push a blank commit (git commit --allow-empty -m "Trigger Build") or rebase to continue.

@puneetkukreja98 puneetkukreja98 marked this pull request as ready for review March 3, 2026 13:00
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@puneetkukreja98 puneetkukreja98 force-pushed the fix-render-button-void-future branch from fd85c25 to 0925a85 Compare March 3, 2026 13:06
@puneetkukreja98
Copy link
Contributor Author

@stuartmorgan-g
Incorporated the revert of the revert as discussed and rebased on latest main.

This PR now:

  1. Restores the fix to prevent _initCalled from being invoked twice on web.
  2. Fixes renderButton being stuck on "Getting ready" due to incorrect FutureBuilder state handling.
  3. Adds an integration test and updates the CHANGELOG (1.1.3).

Ready for review.

srivats22 and others added 4 commits March 13, 2026 21:50
…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.
@puneetkukreja98 puneetkukreja98 force-pushed the fix-render-button-void-future branch from 0925a85 to beabfa0 Compare March 13, 2026 16:21
@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label Mar 13, 2026
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 13, 2026
@auto-submit auto-submit bot merged commit d809b4f into flutter:main Mar 13, 2026
81 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 16, 2026
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Mar 16, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: google_sign_in platform-web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google_sign_in_web] _initCalled completed twice

5 participants