Skip to content

Commit

Permalink
[google_sign_in] Correct clearAuthCache declarations (#5693)
Browse files Browse the repository at this point in the history
During the NNBD migrations, the platform interface version was correctly converted to `required String token`, but the implementation (which was eventually copied during fully federating the plugin) was instead changed to `String? token`. Since accepting a nullable type is a valid override of accepting a non-nullable type it still compiled, but added unnecessary force unwrapping to the implementations. This cleans up the implementation declarations to match the platform interface.

Part of flutter/flutter#129717
  • Loading branch information
stuartmorgan committed Jan 3, 2024
1 parent d18ee34 commit bff79f6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/google_sign_in/google_sign_in_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 6.1.21

* Updates `clearAuthCache` override to match base class declaration.
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.

## 6.1.20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ class GoogleSignInAndroid extends GoogleSignInPlatform {
}

@override
Future<void> clearAuthCache({String? token}) {
// The token is not acutally nullable; see
// https://github.com/flutter/flutter/issues/129717
return _api.clearAuthCache(token!);
Future<void> clearAuthCache({required String token}) {
return _api.clearAuthCache(token);
}

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_sign_in_android
description: Android implementation of the google_sign_in plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
version: 6.1.20
version: 6.1.21

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/google_sign_in/google_sign_in_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.7.2

* Updates `clearAuthCache` override to match base class declaration.

## 5.7.1

* Changes `pigeon` to a dev dependency.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class GoogleSignInIOS extends GoogleSignInPlatform {
}

@override
Future<void> clearAuthCache({String? token}) async {
Future<void> clearAuthCache({required String token}) async {
// There's nothing to be done here on iOS since the expired/invalid
// tokens are refreshed automatically by getTokens.
}
Expand Down
2 changes: 1 addition & 1 deletion packages/google_sign_in/google_sign_in_ios/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_sign_in_ios
description: iOS implementation of the google_sign_in plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
version: 5.7.1
version: 5.7.2

environment:
sdk: ">=3.2.0 <4.0.0"
Expand Down

0 comments on commit bff79f6

Please sign in to comment.