[gis_web] Properly define optional args. Add scope to config.
This PR adds some tweaks to the JS-interop layer found while using the library to (re)write the package:google_sign_in_gis_web.
The main changes are:
- Mark optional arguments as properly optional (and not nullable, as they were now)
- Adds a (somewhat undocumented)
scopeparameter to theOverridableTokenClientConfig. It appears here: https://developers.google.com/identity/oauth2/web/guides/use-token-model#ajax, but not in the API reference that was used to initially write this API.
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
///). - [ ] 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.
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).
If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?
Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.
~~The untested code is JS-interop code, a (somewhat) "declarative" version of the following APIs:~~
- ~~https://developers.google.com/identity/gsi/web/reference/js-reference~~
- ~~https://developers.google.com/identity/oauth2/web/reference/js-reference~~
~~AFAIK there's no way to assert that a JS-interop layer correctly maps to the underlying JS SDK (without writing tests for, and using, all of the underlying methods in a series of integration tests. Note that even if we had that instrumentation ready, only part of the methods of this particular API can be tested, since our integration tests cannot drive the Authentication process that would be required to assert that any particular "response" fits the JS-interop layer.)~~
Added integration tests by reproducing the underlying expected JS behavior.
Added a couple of integration_tests to assert that the prompt callback is truly optional.