diff --git a/packages/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md similarity index 98% rename from packages/google_sign_in/CHANGELOG.md rename to packages/google_sign_in/google_sign_in/CHANGELOG.md index 300eba20968e..a180ba8e1a3f 100644 --- a/packages/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.12 + +* Move google_sign_in plugin to google_sign_in/google_sign_in to prepare for federated implementations. + ## 4.0.11 * Update iOS CocoaPod dependency to 5.0 to fix deprecated API usage issue. diff --git a/packages/google_sign_in/LICENSE b/packages/google_sign_in/google_sign_in/LICENSE similarity index 100% rename from packages/google_sign_in/LICENSE rename to packages/google_sign_in/google_sign_in/LICENSE diff --git a/packages/google_sign_in/README.md b/packages/google_sign_in/google_sign_in/README.md similarity index 95% rename from packages/google_sign_in/README.md rename to packages/google_sign_in/google_sign_in/README.md index 01c8b5275365..f9e8415f0745 100755 --- a/packages/google_sign_in/README.md +++ b/packages/google_sign_in/google_sign_in/README.md @@ -87,11 +87,11 @@ Future _handleSignIn() async { ## Example -Find the example wiring in the [Google sign-in example application](https://github.com/flutter/plugins/blob/master/packages/google_sign_in/example/lib/main.dart). +Find the example wiring in the [Google sign-in example application](https://github.com/flutter/plugins/blob/master/packages/google_sign_in/google_sign_in/example/lib/main.dart). ## API details -See the [google_sign_in.dart](https://github.com/flutter/plugins/blob/master/packages/google_sign_in/lib/google_sign_in.dart) for more API details. +See the [google_sign_in.dart](https://github.com/flutter/plugins/blob/master/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart) for more API details. ## Issues and feedback diff --git a/packages/google_sign_in/android/build.gradle b/packages/google_sign_in/google_sign_in/android/build.gradle similarity index 100% rename from packages/google_sign_in/android/build.gradle rename to packages/google_sign_in/google_sign_in/android/build.gradle diff --git a/packages/google_sign_in/android/gradle.properties b/packages/google_sign_in/google_sign_in/android/gradle.properties similarity index 100% rename from packages/google_sign_in/android/gradle.properties rename to packages/google_sign_in/google_sign_in/android/gradle.properties diff --git a/packages/google_sign_in/android/settings.gradle b/packages/google_sign_in/google_sign_in/android/settings.gradle similarity index 100% rename from packages/google_sign_in/android/settings.gradle rename to packages/google_sign_in/google_sign_in/android/settings.gradle diff --git a/packages/google_sign_in/android/src/main/AndroidManifest.xml b/packages/google_sign_in/google_sign_in/android/src/main/AndroidManifest.xml similarity index 100% rename from packages/google_sign_in/android/src/main/AndroidManifest.xml rename to packages/google_sign_in/google_sign_in/android/src/main/AndroidManifest.xml diff --git a/packages/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/BackgroundTaskRunner.java b/packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/BackgroundTaskRunner.java similarity index 100% rename from packages/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/BackgroundTaskRunner.java rename to packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/BackgroundTaskRunner.java diff --git a/packages/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/Executors.java b/packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/Executors.java similarity index 100% rename from packages/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/Executors.java rename to packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/Executors.java diff --git a/packages/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java b/packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java similarity index 100% rename from packages/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java rename to packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java diff --git a/packages/google_sign_in/example/README.md b/packages/google_sign_in/google_sign_in/example/README.md similarity index 100% rename from packages/google_sign_in/example/README.md rename to packages/google_sign_in/google_sign_in/example/README.md diff --git a/packages/google_sign_in/example/android.iml b/packages/google_sign_in/google_sign_in/example/android.iml similarity index 100% rename from packages/google_sign_in/example/android.iml rename to packages/google_sign_in/google_sign_in/example/android.iml diff --git a/packages/google_sign_in/example/android/app/build.gradle b/packages/google_sign_in/google_sign_in/example/android/app/build.gradle similarity index 100% rename from packages/google_sign_in/example/android/app/build.gradle rename to packages/google_sign_in/google_sign_in/example/android/app/build.gradle diff --git a/packages/google_sign_in/example/android/app/google-services.json b/packages/google_sign_in/google_sign_in/example/android/app/google-services.json similarity index 100% rename from packages/google_sign_in/example/android/app/google-services.json rename to packages/google_sign_in/google_sign_in/example/android/app/google-services.json diff --git a/packages/google_sign_in/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/google_sign_in/google_sign_in/example/android/app/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/google_sign_in/example/android/app/gradle/wrapper/gradle-wrapper.properties rename to packages/google_sign_in/google_sign_in/example/android/app/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/google_sign_in/example/android/app/src/main/AndroidManifest.xml b/packages/google_sign_in/google_sign_in/example/android/app/src/main/AndroidManifest.xml similarity index 100% rename from packages/google_sign_in/example/android/app/src/main/AndroidManifest.xml rename to packages/google_sign_in/google_sign_in/example/android/app/src/main/AndroidManifest.xml diff --git a/packages/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/.gitignore b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/.gitignore similarity index 100% rename from packages/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/.gitignore rename to packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/.gitignore diff --git a/packages/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/MainActivity.java b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/MainActivity.java similarity index 100% rename from packages/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/MainActivity.java rename to packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/MainActivity.java diff --git a/packages/google_sign_in/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from packages/google_sign_in/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/packages/google_sign_in/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from packages/google_sign_in/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/packages/google_sign_in/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from packages/google_sign_in/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/packages/google_sign_in/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from packages/google_sign_in/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/packages/google_sign_in/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from packages/google_sign_in/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to packages/google_sign_in/google_sign_in/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/packages/google_sign_in/example/android/build.gradle b/packages/google_sign_in/google_sign_in/example/android/build.gradle similarity index 100% rename from packages/google_sign_in/example/android/build.gradle rename to packages/google_sign_in/google_sign_in/example/android/build.gradle diff --git a/packages/google_sign_in/example/android/gradle.properties b/packages/google_sign_in/google_sign_in/example/android/gradle.properties similarity index 100% rename from packages/google_sign_in/example/android/gradle.properties rename to packages/google_sign_in/google_sign_in/example/android/gradle.properties diff --git a/packages/google_sign_in/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/google_sign_in/google_sign_in/example/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/google_sign_in/example/android/gradle/wrapper/gradle-wrapper.properties rename to packages/google_sign_in/google_sign_in/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/google_sign_in/example/android/settings.gradle b/packages/google_sign_in/google_sign_in/example/android/settings.gradle similarity index 100% rename from packages/google_sign_in/example/android/settings.gradle rename to packages/google_sign_in/google_sign_in/example/android/settings.gradle diff --git a/packages/google_sign_in/example/example.iml b/packages/google_sign_in/google_sign_in/example/example.iml similarity index 100% rename from packages/google_sign_in/example/example.iml rename to packages/google_sign_in/google_sign_in/example/example.iml diff --git a/packages/google_sign_in/example/google_sign_in_example.iml b/packages/google_sign_in/google_sign_in/example/google_sign_in_example.iml similarity index 100% rename from packages/google_sign_in/example/google_sign_in_example.iml rename to packages/google_sign_in/google_sign_in/example/google_sign_in_example.iml diff --git a/packages/google_sign_in/example/ios/Flutter/AppFrameworkInfo.plist b/packages/google_sign_in/google_sign_in/example/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from packages/google_sign_in/example/ios/Flutter/AppFrameworkInfo.plist rename to packages/google_sign_in/google_sign_in/example/ios/Flutter/AppFrameworkInfo.plist diff --git a/packages/google_sign_in/example/ios/Flutter/Debug.xcconfig b/packages/google_sign_in/google_sign_in/example/ios/Flutter/Debug.xcconfig similarity index 100% rename from packages/google_sign_in/example/ios/Flutter/Debug.xcconfig rename to packages/google_sign_in/google_sign_in/example/ios/Flutter/Debug.xcconfig diff --git a/packages/google_sign_in/example/ios/Flutter/Release.xcconfig b/packages/google_sign_in/google_sign_in/example/ios/Flutter/Release.xcconfig similarity index 100% rename from packages/google_sign_in/example/ios/Flutter/Release.xcconfig rename to packages/google_sign_in/google_sign_in/example/ios/Flutter/Release.xcconfig diff --git a/packages/google_sign_in/example/ios/Runner.xcodeproj/project.pbxproj b/packages/google_sign_in/google_sign_in/example/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from packages/google_sign_in/example/ios/Runner.xcodeproj/project.pbxproj rename to packages/google_sign_in/google_sign_in/example/ios/Runner.xcodeproj/project.pbxproj diff --git a/packages/google_sign_in/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/google_sign_in/google_sign_in/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/google_sign_in/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to packages/google_sign_in/google_sign_in/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/packages/google_sign_in/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/google_sign_in/google_sign_in/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from packages/google_sign_in/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/google_sign_in/google_sign_in/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/packages/google_sign_in/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/google_sign_in/google_sign_in/example/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/google_sign_in/example/ios/Runner.xcworkspace/contents.xcworkspacedata rename to packages/google_sign_in/google_sign_in/example/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/packages/google_sign_in/example/ios/Runner/AppDelegate.h b/packages/google_sign_in/google_sign_in/example/ios/Runner/AppDelegate.h similarity index 100% rename from packages/google_sign_in/example/ios/Runner/AppDelegate.h rename to packages/google_sign_in/google_sign_in/example/ios/Runner/AppDelegate.h diff --git a/packages/google_sign_in/example/ios/Runner/AppDelegate.m b/packages/google_sign_in/google_sign_in/example/ios/Runner/AppDelegate.m similarity index 100% rename from packages/google_sign_in/example/ios/Runner/AppDelegate.m rename to packages/google_sign_in/google_sign_in/example/ios/Runner/AppDelegate.m diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/packages/google_sign_in/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/google_sign_in/google_sign_in/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/packages/google_sign_in/example/ios/Runner/Base.lproj/Main.storyboard b/packages/google_sign_in/google_sign_in/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Base.lproj/Main.storyboard rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/packages/google_sign_in/example/ios/Runner/GoogleService-Info.plist b/packages/google_sign_in/google_sign_in/example/ios/Runner/GoogleService-Info.plist similarity index 100% rename from packages/google_sign_in/example/ios/Runner/GoogleService-Info.plist rename to packages/google_sign_in/google_sign_in/example/ios/Runner/GoogleService-Info.plist diff --git a/packages/google_sign_in/example/ios/Runner/Info.plist b/packages/google_sign_in/google_sign_in/example/ios/Runner/Info.plist similarity index 100% rename from packages/google_sign_in/example/ios/Runner/Info.plist rename to packages/google_sign_in/google_sign_in/example/ios/Runner/Info.plist diff --git a/packages/google_sign_in/example/ios/Runner/main.m b/packages/google_sign_in/google_sign_in/example/ios/Runner/main.m similarity index 100% rename from packages/google_sign_in/example/ios/Runner/main.m rename to packages/google_sign_in/google_sign_in/example/ios/Runner/main.m diff --git a/packages/google_sign_in/example/lib/main.dart b/packages/google_sign_in/google_sign_in/example/lib/main.dart similarity index 100% rename from packages/google_sign_in/example/lib/main.dart rename to packages/google_sign_in/google_sign_in/example/lib/main.dart diff --git a/packages/google_sign_in/example/pubspec.yaml b/packages/google_sign_in/google_sign_in/example/pubspec.yaml similarity index 100% rename from packages/google_sign_in/example/pubspec.yaml rename to packages/google_sign_in/google_sign_in/example/pubspec.yaml diff --git a/packages/google_sign_in/ios/Assets/.gitkeep b/packages/google_sign_in/google_sign_in/ios/Assets/.gitkeep similarity index 100% rename from packages/google_sign_in/ios/Assets/.gitkeep rename to packages/google_sign_in/google_sign_in/ios/Assets/.gitkeep diff --git a/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.h b/packages/google_sign_in/google_sign_in/ios/Classes/GoogleSignInPlugin.h similarity index 100% rename from packages/google_sign_in/ios/Classes/GoogleSignInPlugin.h rename to packages/google_sign_in/google_sign_in/ios/Classes/GoogleSignInPlugin.h diff --git a/packages/google_sign_in/ios/Classes/GoogleSignInPlugin.m b/packages/google_sign_in/google_sign_in/ios/Classes/GoogleSignInPlugin.m similarity index 100% rename from packages/google_sign_in/ios/Classes/GoogleSignInPlugin.m rename to packages/google_sign_in/google_sign_in/ios/Classes/GoogleSignInPlugin.m diff --git a/packages/google_sign_in/ios/google_sign_in.podspec b/packages/google_sign_in/google_sign_in/ios/google_sign_in.podspec similarity index 100% rename from packages/google_sign_in/ios/google_sign_in.podspec rename to packages/google_sign_in/google_sign_in/ios/google_sign_in.podspec diff --git a/packages/google_sign_in/lib/google_sign_in.dart b/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart similarity index 100% rename from packages/google_sign_in/lib/google_sign_in.dart rename to packages/google_sign_in/google_sign_in/lib/google_sign_in.dart diff --git a/packages/google_sign_in/lib/src/common.dart b/packages/google_sign_in/google_sign_in/lib/src/common.dart similarity index 100% rename from packages/google_sign_in/lib/src/common.dart rename to packages/google_sign_in/google_sign_in/lib/src/common.dart diff --git a/packages/google_sign_in/lib/testing.dart b/packages/google_sign_in/google_sign_in/lib/testing.dart similarity index 100% rename from packages/google_sign_in/lib/testing.dart rename to packages/google_sign_in/google_sign_in/lib/testing.dart diff --git a/packages/google_sign_in/lib/widgets.dart b/packages/google_sign_in/google_sign_in/lib/widgets.dart similarity index 100% rename from packages/google_sign_in/lib/widgets.dart rename to packages/google_sign_in/google_sign_in/lib/widgets.dart diff --git a/packages/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml similarity index 92% rename from packages/google_sign_in/pubspec.yaml rename to packages/google_sign_in/google_sign_in/pubspec.yaml index e239e01c3b44..d3331d24f55d 100644 --- a/packages/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -2,8 +2,8 @@ name: google_sign_in description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in -version: 4.0.11 +homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in +version: 4.0.12 flutter: plugin: diff --git a/packages/google_sign_in/test/google_sign_in_test.dart b/packages/google_sign_in/google_sign_in/test/google_sign_in_test.dart similarity index 100% rename from packages/google_sign_in/test/google_sign_in_test.dart rename to packages/google_sign_in/google_sign_in/test/google_sign_in_test.dart diff --git a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md new file mode 100644 index 000000000000..0d8803f93540 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +* Initial release. diff --git a/packages/google_sign_in/google_sign_in_platform_interface/LICENSE b/packages/google_sign_in/google_sign_in_platform_interface/LICENSE new file mode 100644 index 000000000000..c89293372cf3 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_sign_in/google_sign_in_platform_interface/README.md b/packages/google_sign_in/google_sign_in_platform_interface/README.md new file mode 100644 index 000000000000..9fd891f63968 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/README.md @@ -0,0 +1,26 @@ +# google_sign_in_platform_interface + +A common platform interface for the [`google_sign_in`][1] plugin. + +This interface allows platform-specific implementations of the `google_sign_in` +plugin, as well as the plugin itself, to ensure they are supporting the +same interface. + +# Usage + +To implement a new platform-specific implementation of `google_sign_in`, extend +[`GoogleSignInPlatform`][2] with an implementation that performs the +platform-specific behavior, and when you register your plugin, set the default +`GoogleSignInPlatform` by calling +`GoogleSignInPlatform.instance = MyPlatformGoogleSignIn()`. + +# Note on breaking changes + +Strongly prefer non-breaking changes (such as adding a method to the interface) +over breaking changes for this package. + +See https://flutter.dev/go/platform-interface-breaking-changes for a discussion +on why a less-clean interface is preferable to a breaking change. + +[1]: ../google_sign_in +[2]: lib/google_sign_in_platform_interface.dart diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/google_sign_in_platform_interface.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/google_sign_in_platform_interface.dart new file mode 100644 index 000000000000..8e4e4541a388 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/google_sign_in_platform_interface.dart @@ -0,0 +1,109 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; +import 'package:meta/meta.dart' show required, visibleForTesting; +import 'src/method_channel_google_sign_in.dart'; +import 'src/types.dart'; + +export 'src/method_channel_google_sign_in.dart'; +export 'src/types.dart'; + +/// The interface that implementations of google_sign_in must implement. +/// +/// Platform implementations that live in a separate package should extend this +/// class rather than implement it as `google_sign_in` does not consider newly +/// added methods to be breaking changes. Extending this class (using `extends`) +/// ensures that the subclass will get the default implementation, while +/// platform implementations that `implements` this interface will be broken by +/// newly added [GoogleSignInPlatform] methods. +abstract class GoogleSignInPlatform { + /// Only mock implementations should set this to `true`. + /// + /// Mockito mocks implement this class with `implements` which is forbidden + /// (see class docs). This property provides a backdoor for mocks to skip the + /// verification that the class isn't implemented with `implements`. + @visibleForTesting + bool get isMock => false; + + /// The default instance of [GoogleSignInPlatform] to use. + /// + /// Platform-specific plugins should override this with their own + /// platform-specific class that extends [GoogleSignInPlatform] when they + /// register themselves. + /// + /// Defaults to [MethodChannelGoogleSignIn]. + static GoogleSignInPlatform get instance => _instance; + + static GoogleSignInPlatform _instance = MethodChannelGoogleSignIn(); + + // TODO(amirh): Extract common platform interface logic. + // https://github.com/flutter/flutter/issues/43368 + static set instance(GoogleSignInPlatform instance) { + if (!instance.isMock) { + try { + instance._verifyProvidesDefaultImplementations(); + } on NoSuchMethodError catch (_) { + throw AssertionError( + 'Platform interfaces must not be implemented with `implements`'); + } + } + _instance = instance; + } + + /// This method ensures that [GoogleSignInPlatform] isn't implemented with `implements`. + /// + /// See class docs for more details on why using `implements` to implement + /// [GoogleSignInPlatform] is forbidden. + /// + /// This private method is called by the [instance] setter, which should fail + /// if the provided instance is a class implemented with `implements`. + void _verifyProvidesDefaultImplementations() {} + + /// Initializes the plugin. You must call this method before calling other methods. + /// See: https://developers.google.com/identity/sign-in/web/reference#gapiauth2initparams + Future init( + {@required String hostedDomain, + List scopes, + SignInOption signInOption, + String clientId}) async { + throw UnimplementedError('init() has not been implemented.'); + } + + /// Attempts to reuse pre-existing credentials to sign in again, without user interaction. + Future signInSilently() async { + throw UnimplementedError('signInSilently() has not been implemented.'); + } + + /// Signs in the user with the options specified to [init]. + Future signIn() async { + throw UnimplementedError('signIn() has not been implemented.'); + } + + /// Returns the Tokens used to authenticate other API calls. + Future getTokens( + {@required String email, bool shouldRecoverAuth}) async { + throw UnimplementedError('getTokens() has not been implemented.'); + } + + /// Signs out the current account from the application. + Future signOut() async { + throw UnimplementedError('signOut() has not been implemented.'); + } + + /// Revokes all of the scopes that the user granted. + Future disconnect() async { + throw UnimplementedError('disconnect() has not been implemented.'); + } + + /// Returns whether the current user is currently signed in. + Future isSignedIn() async { + throw UnimplementedError('isSignedIn() has not been implemented.'); + } + + /// Clears any cached information that the plugin may be holding on to. + Future clearAuthCache({@required String token}) async { + throw UnimplementedError('clearAuthCache() has not been implemented.'); + } +} diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/method_channel_google_sign_in.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/method_channel_google_sign_in.dart new file mode 100644 index 000000000000..bc52a73868eb --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/method_channel_google_sign_in.dart @@ -0,0 +1,79 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show required, visibleForTesting; + +import '../google_sign_in_platform_interface.dart'; +import 'types.dart'; +import 'utils.dart'; + +/// An implementation of [GoogleSignInPlatform] that uses method channels. +class MethodChannelGoogleSignIn extends GoogleSignInPlatform { + @visibleForTesting + MethodChannel channel = + const MethodChannel('plugins.flutter.io/google_sign_in'); + + @override + Future init( + {@required String hostedDomain, + List scopes = const [], + SignInOption signInOption = SignInOption.standard, + String clientId}) { + return channel.invokeMethod('init', { + 'signInOption': signInOption.toString(), + 'scopes': scopes, + 'hostedDomain': hostedDomain, + }); + } + + @override + Future signInSilently() { + return channel + .invokeMapMethod('signInSilently') + .then(getUserDataFromMap); + } + + @override + Future signIn() { + return channel + .invokeMapMethod('signIn') + .then(getUserDataFromMap); + } + + @override + Future getTokens( + {String email, bool shouldRecoverAuth = true}) { + return channel + .invokeMapMethod('getTokens', { + 'email': email, + 'shouldRecoverAuth': shouldRecoverAuth, + }).then(getTokenDataFromMap); + } + + @override + Future signOut() { + return channel.invokeMapMethod('signOut'); + } + + @override + Future disconnect() { + return channel.invokeMapMethod('disconnect'); + } + + @override + Future isSignedIn() { + return channel.invokeMethod('isSignedIn'); + } + + @override + Future clearAuthCache({String token}) { + return channel.invokeMethod( + 'clearAuthCache', + {'token': token}, + ); + } +} diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart new file mode 100644 index 000000000000..98b73c0667f2 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart @@ -0,0 +1,51 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:quiver_hashcode/hashcode.dart'; + +enum SignInOption { standard, games } + +class GoogleSignInUserData { + GoogleSignInUserData( + {this.displayName, this.email, this.id, this.photoUrl, this.idToken}); + String displayName; + String email; + String id; + String photoUrl; + String idToken; + + @override + int get hashCode => + hashObjects([displayName, email, id, photoUrl, idToken]); + + @override + bool operator ==(dynamic other) { + if (identical(this, other)) return true; + if (other is! GoogleSignInUserData) return false; + final GoogleSignInUserData otherUserData = other; + return otherUserData.displayName == displayName && + otherUserData.email == email && + otherUserData.id == id && + otherUserData.photoUrl == photoUrl && + otherUserData.idToken == idToken; + } +} + +class GoogleSignInTokenData { + GoogleSignInTokenData({this.idToken, this.accessToken}); + String idToken; + String accessToken; + + @override + int get hashCode => hash2(idToken, accessToken); + + @override + bool operator ==(dynamic other) { + if (identical(this, other)) return true; + if (other is! GoogleSignInTokenData) return false; + final GoogleSignInTokenData otherTokenData = other; + return otherTokenData.idToken == idToken && + otherTokenData.accessToken == accessToken; + } +} diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart new file mode 100644 index 000000000000..eb60f00cba63 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart @@ -0,0 +1,29 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import '../google_sign_in_platform_interface.dart'; + +/// Converts user data coming from native code into the proper platform interface type. +GoogleSignInUserData getUserDataFromMap(Map data) { + if (data == null) { + return null; + } + return GoogleSignInUserData( + displayName: data['displayName'], + email: data['email'], + id: data['id'], + photoUrl: data['photoUrl'], + idToken: data['idToken']); +} + +/// Converts token data coming from native code into the proper platform interface type. +GoogleSignInTokenData getTokenDataFromMap(Map data) { + if (data == null) { + return null; + } + return GoogleSignInTokenData( + idToken: data['idToken'], + accessToken: data['accessToken'], + ); +} diff --git a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml new file mode 100644 index 000000000000..ceba7a1c516a --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml @@ -0,0 +1,22 @@ +name: google_sign_in_platform_interface +description: A common platform interface for the google_sign_in plugin. +author: Flutter Team +homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in_platform_interface +# NOTE: We strongly prefer non-breaking changes, even at the expense of a +# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes +version: 1.0.0 + +dependencies: + flutter: + sdk: flutter + meta: ^1.0.5 + quiver_hashcode: ^2.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + mockito: ^4.1.1 + +environment: + sdk: ">=2.0.0-dev.28.0 <3.0.0" + flutter: ">=1.5.0 <2.0.0" diff --git a/packages/google_sign_in/google_sign_in_platform_interface/test/google_sign_in_platform_interface_test.dart b/packages/google_sign_in/google_sign_in_platform_interface/test/google_sign_in_platform_interface_test.dart new file mode 100644 index 000000000000..f411b8992821 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/test/google_sign_in_platform_interface_test.dart @@ -0,0 +1,37 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +void main() { + group('$GoogleSignInPlatform', () { + test('$MethodChannelGoogleSignIn is the default instance', () { + expect(GoogleSignInPlatform.instance, isA()); + }); + + test('Cannot be implemented with `implements`', () { + expect(() { + GoogleSignInPlatform.instance = ImplementsGoogleSignInPlatform(); + }, throwsAssertionError); + }); + + test('Can be extended', () { + GoogleSignInPlatform.instance = ExtendsGoogleSignInPlatform(); + }); + + test('Can be mocked with `implements`', () { + final ImplementsGoogleSignInPlatform mock = + ImplementsGoogleSignInPlatform(); + when(mock.isMock).thenReturn(true); + GoogleSignInPlatform.instance = mock; + }); + }); +} + +class ImplementsGoogleSignInPlatform extends Mock + implements GoogleSignInPlatform {} + +class ExtendsGoogleSignInPlatform extends GoogleSignInPlatform {} diff --git a/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart b/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart new file mode 100644 index 000000000000..13de6acf0748 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart @@ -0,0 +1,127 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; +import 'package:google_sign_in_platform_interface/src/types.dart'; +import 'package:google_sign_in_platform_interface/src/utils.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +const Map kUserData = { + "email": "john.doe@gmail.com", + "id": "8162538176523816253123", + "photoUrl": "https://lh5.googleusercontent.com/photo.jpg", + "displayName": "John Doe", +}; + +const Map kTokenData = { + 'idToken': '123', + 'accessToken': '456', +}; + +const Map kDefaultResponses = { + 'init': null, + 'signInSilently': kUserData, + 'signIn': kUserData, + 'signOut': null, + 'disconnect': null, + 'isSignedIn': true, + 'getTokens': kTokenData, +}; + +final GoogleSignInUserData kUser = getUserDataFromMap(kUserData); +final GoogleSignInTokenData kToken = getTokenDataFromMap(kTokenData); + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + group('$MethodChannelGoogleSignIn', () { + final MethodChannelGoogleSignIn googleSignIn = MethodChannelGoogleSignIn(); + final MethodChannel channel = googleSignIn.channel; + + final List log = []; + Map responses; // Some tests mutate some kDefaultResponses + + setUp(() { + responses = Map.from(kDefaultResponses); + channel.setMockMethodCallHandler((MethodCall methodCall) { + log.add(methodCall); + final dynamic response = responses[methodCall.method]; + if (response != null && response is Exception) { + return Future.error('$response'); + } + return Future.value(response); + }); + log.clear(); + }); + + test('signInSilently transforms platform data to GoogleSignInUserData', + () async { + final dynamic response = await googleSignIn.signInSilently(); + expect(response, kUser); + }); + test('signInSilently Exceptions -> throws', () async { + responses['signInSilently'] = Exception('Not a user'); + expect(googleSignIn.signInSilently(), + throwsA(isInstanceOf())); + }); + + test('signIn transforms platform data to GoogleSignInUserData', () async { + final dynamic response = await googleSignIn.signIn(); + expect(response, kUser); + }); + test('signIn Exceptions -> throws', () async { + responses['signIn'] = Exception('Not a user'); + expect(googleSignIn.signIn(), throwsA(isInstanceOf())); + }); + + test('getTokens transforms platform data to GoogleSignInTokenData', + () async { + final dynamic response = await googleSignIn.getTokens( + email: 'example@example.com', shouldRecoverAuth: false); + expect(response, kToken); + expect( + log[0], + isMethodCall('getTokens', arguments: { + 'email': 'example@example.com', + 'shouldRecoverAuth': false, + })); + }); + + test('Other functions pass through arguments to the channel', () async { + final Map tests = { + () { + googleSignIn.init( + hostedDomain: 'example.com', + scopes: ['two', 'scopes'], + signInOption: SignInOption.games, + clientId: 'UNUSED!'); + }: isMethodCall('init', arguments: { + 'hostedDomain': 'example.com', + 'scopes': ['two', 'scopes'], + 'signInOption': 'SignInOption.games', + }), + () { + googleSignIn.getTokens( + email: 'example@example.com', shouldRecoverAuth: false); + }: isMethodCall('getTokens', arguments: { + 'email': 'example@example.com', + 'shouldRecoverAuth': false, + }), + () { + googleSignIn.clearAuthCache(token: 'abc'); + }: isMethodCall('clearAuthCache', arguments: { + 'token': 'abc', + }), + googleSignIn.signOut: isMethodCall('signOut', arguments: null), + googleSignIn.disconnect: isMethodCall('disconnect', arguments: null), + googleSignIn.isSignedIn: isMethodCall('isSignedIn', arguments: null), + }; + + tests.keys.forEach((Function f) => f()); + + expect(log, tests.values); + }); + }); +}