-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[google_sign_in] Port plugin to use the federated Platform Interface #2266
[google_sign_in] Port plugin to use the federated Platform Interface #2266
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
instead of MethodChannels.
* Refactor endlessly growing --exclude param value into a string that gets generated for a list of plugin names.
* Throw in some trailing commas to make dartfmt nicer
ba2b8ae
to
7d626a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. Left some nits.
final Map<String, dynamic> response = | ||
await channel.invokeMapMethod<String, dynamic>(method); | ||
return _setCurrentUser(response != null && response.isNotEmpty | ||
final dynamic response = await method(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would happen if the method
is not an async function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! It seems to work, though, check this DartPad!
@@ -251,6 +244,7 @@ class GoogleSignIn { | |||
final Completer<void> completer = Completer<void>(); | |||
future.whenComplete(completer.complete).catchError((dynamic _) { | |||
// Ignore if previous call completed with an error. | |||
// TODO: Should we log errors here, if debug or similar? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll revisit this to add logging, so you guys can discuss how much of it we need :)
(I'd recommend that this gets logged at the lowest level that makes sense, like trace or similar)
…lutter#2266) * Port google_sign_in.dart to use the federated Platform Interface, instead of MethodChannels. * Ignore google_sign_in_platform_interface on all-plugins-app call. * Refactor endlessly growing --exclude param value into a string that gets generated for a list of plugin names.
* newCache/blackVideos: (105 commits) [connectivity] Fix reachability stream for iOS (flutter#2281) [google_sign_in] Port plugin to use the federated Platform Interface (flutter#2266) [webview_flutter] Add async NavigationDelegates (flutter#2257) Update cirrus to create IOS simulator on 13.2 an xCode 11 (flutter#2275) [battery] Update and migrate iOS example project (flutter#2089) [url_launcher] DartDoc and test improvements (flutter#2274) [google_maps_flutter] Define clang module for iOS, fix analyzer warnings (flutter#2182) [video_player] Add v2 embedding support (flutter#2226) [path_provider] Update and migrate iOS example project (flutter#2099) [sensors] Documentation and test improvements (flutter#2272) [image_picker] Lint for public DartDocs (flutter#2270) [connectivity] Lint for public DartDocs (flutter#2269) [shared_preferences] Update and migrate iOS example project (flutter#2103) [quick_actions] Update and migrate iOS example project (flutter#2100) [infra] Ignore analyzer issues in CI (flutter#2271) [android_intent] Add missing DartDocs (flutter#2268) Bump google_maps_flutter pubspec to match CHANGELOG (flutter#2267) [google_sign_in] Handle new style URLs in GoogleUserCircleAvatar (flutter#2252) [google_sign_in] Move plugin to its subdir to allow for federated implementations. Add platform interface. (flutter#2244) Make setMockInitialValues handle non-prefixed keys (flutter#2260) ... # Conflicts: # packages/video_player/CHANGELOG.md # packages/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java # packages/video_player/ios/video_player.podspec # packages/video_player/pubspec.yaml # packages/video_player/test/video_player_test.dart
…lutter#2266) * Port google_sign_in.dart to use the federated Platform Interface, instead of MethodChannels. * Ignore google_sign_in_platform_interface on all-plugins-app call. * Refactor endlessly growing --exclude param value into a string that gets generated for a list of plugin names.
Description
This is required for plugin federation (to implement the Web version in a separate package)
The
GoogleSignInPlatform.instance
interface is defined (and implemented) in thegoogle_sign_in_platform_interface
package, here.Related Issues
flutter/flutter#43775
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?