Skip to content

Commit ece0d7b

Browse files
[google_sign_in] Correct method channel clearAuthCache declaration (#5787)
During the NNBD migrations, the platform interface version was correctly converted to `required String token`, but the implementation 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 default method channel implementation declaration to match the platform interface. Fixes flutter/flutter#129717
1 parent bff79f6 commit ece0d7b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.4.4
2+
3+
* Updates `clearAuthCache` override to match base class declaration.
4+
15
## 2.4.3
26

37
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.

packages/google_sign_in/google_sign_in_platform_interface/lib/src/method_channel_google_sign_in.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class MethodChannelGoogleSignIn extends GoogleSignInPlatform {
8484
}
8585

8686
@override
87-
Future<void> clearAuthCache({String? token}) {
87+
Future<void> clearAuthCache({required String token}) {
8888
return channel.invokeMethod<void>(
8989
'clearAuthCache',
9090
<String, String?>{'token': token},

packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_sign_i
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
55
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7-
version: 2.4.3
7+
version: 2.4.4
88

99
environment:
1010
sdk: ">=3.0.0 <4.0.0"

0 commit comments

Comments
 (0)