-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[google_sign_in] Adds "Button" Sign In for Web. #3461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
32a3619
[gsi_interface] Introduces 'canAccessScopes' and 'userDataEvents'.
ditman b5cda64
[google_sign_in] Exposes new 'canAccessScopes' method.
ditman 99e3d47
[gsi_web] Adds renderButton and more.
ditman d54fc07
[gsi_web] Adds button_tester example app.
ditman 473fd1c
[google_sign_in] Update example to the latest API.
ditman 6a991bc
[google_sign_in] Hide sign_in_button behind a conditional import.
ditman fecd765
[gsi_web] Appease analyzer.
ditman 92b6b92
[gis_web] Tidy up flex view. Add integration tests.
ditman 04a873e
[gis_web] Update mockito mocks after update.
ditman dbf5fe4
[google_sign_in] Use the correct token to check for authorization.
ditman 9a4242a
[gsi_web] Add integration tests for new methods.
ditman 73ce2fd
[gsi_interface] Tweak canAccessScopes API.
ditman 6e97ac7
[gsi_web] Conform to interface. Cleanup.
ditman e97d5e4
[google_sign_in] Update to the new API. Cleanup and docs.
ditman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/google_sign_in/google_sign_in/example/lib/src/sign_in_button.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
export 'sign_in_button/stub.dart' | ||
if (dart.library.js_util) 'sign_in_button/web.dart' | ||
if (dart.library.io) 'sign_in_button/mobile.dart'; |
15 changes: 15 additions & 0 deletions
15
packages/google_sign_in/google_sign_in/example/lib/src/sign_in_button/mobile.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2013 The Flutter 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:flutter/material.dart'; | ||
|
||
import 'stub.dart'; | ||
|
||
/// Renders a SIGN IN button that calls `handleSignIn` onclick. | ||
Widget buildSignInButton({HandleSignInFn? onPressed}) { | ||
return ElevatedButton( | ||
onPressed: onPressed, | ||
child: const Text('SIGN IN'), | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/google_sign_in/google_sign_in/example/lib/src/sign_in_button/stub.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2013 The Flutter 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/material.dart'; | ||
|
||
/// The type of the onClick callback for the (mobile) Sign In Button. | ||
typedef HandleSignInFn = Future<void> Function(); | ||
|
||
/// Renders a SIGN IN button that (maybe) calls the `handleSignIn` onclick. | ||
Widget buildSignInButton({HandleSignInFn? onPressed}) { | ||
return Container(); | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/google_sign_in/google_sign_in/example/lib/src/sign_in_button/web.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2013 The Flutter 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:flutter/material.dart'; | ||
import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; | ||
import 'package:google_sign_in_web/google_sign_in_web.dart' as web; | ||
|
||
import 'stub.dart'; | ||
|
||
/// Renders a web-only SIGN IN button. | ||
Widget buildSignInButton({HandleSignInFn? onPressed}) { | ||
return (GoogleSignInPlatform.instance as web.GoogleSignInPlugin) | ||
.renderButton(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.