Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address change requests for google_sign_in_web
  • Loading branch information
blaugold committed Jun 23, 2022
commit d0d4fcd7fbfa1b4b2fea558f63b093f5b5e05dde
3 changes: 3 additions & 0 deletions packages/google_sign_in/google_sign_in_web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ GoogleSignIn _googleSignIn = GoogleSignIn(
],
);
```

[Full list of available scopes](https://developers.google.com/identity/protocols/googlescopes).

Note that the `serverClientId` parameter of the `GoogleSignIn` constructor is not supported on Web.

You can now use the `GoogleSignIn` class to authenticate in your Dart code, e.g.

```dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class GoogleSignInPlugin extends GoogleSignInPlatform {
late Future<void> _isAuthInitialized;
bool _isInitCalled = false;

// This method throws if initWithParams hasn't been called at some point in
// the past. It is used by the [initialized] getter to ensure that users can't
// await on a Future that will never resolve.
void _assertIsInitializeCalled() {
// This method throws if init or initWithParams hasn't been called at some
// point in the past. It is used by the [initialized] getter to ensure that
// users can't await on a Future that will never resolve.
void _assertIsInitCalled() {
if (!_isInitCalled) {
throw StateError(
'GoogleSignInPlugin::init() or GoogleSignInPlugin::initWithParams() '
Expand All @@ -56,7 +56,7 @@ class GoogleSignInPlugin extends GoogleSignInPlatform {
/// A future that resolves when both GAPI and Auth2 have been correctly initialized.
@visibleForTesting
Future<void> get initialized {
_assertIsInitializeCalled();
_assertIsInitCalled();
return Future.wait(<Future<void>>[_isGapiInitialized, _isAuthInitialized]);
}

Expand Down Expand Up @@ -89,7 +89,7 @@ class GoogleSignInPlugin extends GoogleSignInPlatform {
appClientId != null,
'ClientID not set. Either set it on a '
'<meta name="google-signin-client_id" content="CLIENT_ID" /> tag,'
' or pass clientId when calling initialize()');
' or pass clientId when initializing GoogleSignIn');

assert(params.serverClientId == null,
'serverClientId is not supported on Web.');
Expand Down