Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@stuartmorgan-g
Copy link
Contributor

Converts google_sign_in_android and google_sign_in_ios to use internal method channels instead of the shared method channels. This was done by:

  • Copying the default method channel, its supporting utils.dart file, and its test into each package, unchanged.
  • Renaming the files and classes, and updating the test files to point to the right class.
  • Renaming the channel itself to use a different name from the shared channel
  • Adding the Dart registration logic (and tests for it), and bumping the minimum version to 2.8 where Dart registration for mobile was added.

I made a few extra changes:

  • Added an integration test that at least validates that the platform channel is using the right name, since the existing test was a placeholder that didn't validate anything about the interaction with the native side.
  • Did some low-hanging-fruit simplification of the iOS implementation:
    • Removed a no-op method that was only there for Android, no-oping it on the Dart side
    • Moved throwing on a sign-in type that is Android-only to the Dart side (keeping the same code and message for compatibility)
    • Added Dart unit tests of those changes.

Part of flutter/flutter#94224

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • 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.
  • All existing and new tests are passing.

@stuartmorgan-g
Copy link
Contributor Author

It's probably easier to start by reviewing the individual commits so you can see the things I actually changed relative to the previous implementation. I'm happy to make changes to the code that I was duplicating as well though, if you want to review that for things that you would like improved in the new copy.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

It's probably easier to start by reviewing the individual commits so you can see the things I actually changed relative to the previous implementation.

This was a good idea. 🙂

LGTM!

@stuartmorgan-g stuartmorgan-g added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Apr 27, 2022
@fluttergithubbot fluttergithubbot merged commit a9d5a93 into flutter:main Apr 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 28, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 28, 2022
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p: google_sign_in platform-android platform-ios waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants