From 10bc130477968b9760ed190231b9b8331b9a2489 Mon Sep 17 00:00:00 2001 From: stuartmorgan-g Date: Mon, 7 Jul 2025 11:31:13 -0400 Subject: [PATCH 1/3] [google_sign_in] Add exception info to migration guide Adds discussion of the new exception flows to the migration guide. --- packages/google_sign_in/google_sign_in/MIGRATION.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/google_sign_in/google_sign_in/MIGRATION.md b/packages/google_sign_in/google_sign_in/MIGRATION.md index 1369767d102..03b627bbe22 100644 --- a/packages/google_sign_in/google_sign_in/MIGRATION.md +++ b/packages/google_sign_in/google_sign_in/MIGRATION.md @@ -61,3 +61,10 @@ include: publishing, the only platform that does not support `authenticate` is web, where `google_sign_in_web`'s `renderButton` is used to create a sign-in button. +* Outcomes other than successful authentication or authorization will throw + `GoogleSignInException`s in most cases, allowing a clear way to distinguish + different sign in failure outcomes. This includes the user canceling + sign-in, which will throw an exception with a `code` of + `GoogleSignInExceptionCode.canceled`. + * Similarly, the `authenticationEvents` will receive exceptions as + stream errors, unlike the event stream from version 6.x. From 8991000e226a47cdaa663e637320dc0a584c1fab Mon Sep 17 00:00:00 2001 From: stuartmorgan-g Date: Mon, 7 Jul 2025 13:03:56 -0400 Subject: [PATCH 2/3] Update CHANGELOG.md --- packages/google_sign_in/google_sign_in/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index be48f29021e..3aa79eae4de 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Adds information about `GoogleSignInException` to the migration guide. + ## 7.1.0 * Adds the missing export of `GoogleSignInExceptionCode`, to allow for From 0b50c82dc5a77eb2f4dae3a52302ebbe44736bd2 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 8 Jul 2025 12:57:15 -0400 Subject: [PATCH 3/3] Add more docs to initialize --- packages/google_sign_in/google_sign_in/CHANGELOG.md | 4 +++- .../google_sign_in/google_sign_in/lib/google_sign_in.dart | 8 +++++--- packages/google_sign_in/google_sign_in/pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index 3aa79eae4de..7b8950b5962 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,5 +1,7 @@ -## NEXT +## 7.1.1 +* Adds more documentation about the requirement to call `initialize` exactly + once. * Adds information about `GoogleSignInException` to the migration guide. ## 7.1.0 diff --git a/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart b/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart index f4d780333d0..bf4318bcca9 100644 --- a/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart +++ b/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart @@ -233,14 +233,16 @@ class GoogleSignIn { /// Returns the single [GoogleSignIn] instance. /// - /// [initialize] must be called on this instance, and its future allowed to - /// complete, before any other methods on the object are called. + /// [initialize] must be called on this instance exactly once, and its future + /// allowed to complete, before any other methods on the object are called. static final GoogleSignIn instance = GoogleSignIn._(); /// Initializes the sign in manager with the given configuration. /// /// Clients must call this method exactly once, and wait for its future to - /// complete, before calling any other methods on this object. + /// complete, before calling any other methods on this object. Calling other + /// methods without waiting for this method to return, or calling this method + /// more than once, will result in undefined behavior. /// /// [clientId] is the identifier for your client application, as provided by /// the Google Sign In server configuration, if any. This does not need to be diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index 5e7a31ff4a8..a729c9866b2 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 7.1.0 +version: 7.1.1 environment: sdk: ^3.6.0