[google_sign_in] Adds "Button" Sign In for Web.
This PR modifies the Google Sign In plugin so Web application authors can render a "Google Sign In Button" (like this one).
This is needed to obtain a guaranteed idToken from the user that is signing in, since the previous method, signInSilently might be aborted by the user, and the programmatic signIn wouldn't be able to provide that token.
This PR also updates the example apps so they work with the new web API (a combo of renderButton + canAccessScopes + requestScopes), and the mobile API (signIn + requestScopes).
(This is just a RFC PR, since each package needs to be landed separately)
Issues
- Blocked by: https://github.com/flutter/packages/pull/3432
- Fixes https://github.com/flutter/flutter/issues/121781
- Blocks https://github.com/flutter/flutter/issues/121275
- The lack of idToken was mentioned by many users in the original issue.
Testing
- Added tests to core plugin and platform_interface packages.
- Web package needs tests, especially of the "flexible html element view" widget.
- Deployed google_sign_in example:
- https://dit-gis-test.web.app
- Deployed google_sign_in_web "button_tester" example:
- https://dit-gis-button-test.web.app
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
- [x] I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use
dart format.) - [x] I signed the CLA.
- [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g.
[shared_preferences] - [x] I listed at least one issue that this PR fixes in the description above.
- [x] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes. - [x] I updated
CHANGELOG.mdto add a description of the change, following repository CHANGELOG style. - [x] I updated/added relevant documentation (doc comments with
///). - [x] I added new tests to check the change I am making, or this PR is test-exempt.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
�[31mThe following packages had errors:�[0m
�[31m google_sign_in/google_sign_in:
google_sign_in/google_sign_in/example (Android)�[0m
�[31mSee above for full details.�[0m
It's very nice that the CI is catching that I'm breaking the Android compilation. I'll probably need to hide the renderButton call behind a conditional import!
(Android seems to be happy again)
Making PR "ready for review" after pushing some extra tests.
With the deadline for migration to GIS coming up in 5 days, this pull request is fundamental to keep a working google sign in flow. Are we going to have this merged before the 31st? I am more than happy to help if any help is needed to speed up this process.
Someone other than me will need to review the actual web parts.
I'll find somebody to review the web bits as well. Thanks for the rest of the review, I'll correct everything by EOD today.
Rather than rebasing this branch, I'll start creating the independent PRs off of the latest master.
This has been published as google_sign_in: ^6.1.0:
- https://pub.dev/packages/google_sign_in/changelog#610
Version: google_sign_in_web: ^0.12.0
Bug description: The Google sign-in button and icon are not being displayed.
Cause: Whenever the SelectionArea is used in the outer or top-level layer, and the login page is displayed using a dialog, the Google sign-in button and icon are not being rendered. Removing the SelectionArea resolves the issue.
Please use the issue tracker to report issues; the PR is for reviewing the change before landing it (which has already happened).