Skip to content

Commit

Permalink
[google_sign_in] Correct method channel clearAuthCache declaration (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
stuartmorgan committed Jan 3, 2024
1 parent bff79f6 commit ece0d7b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.4.4

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

## 2.4.3

* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class MethodChannelGoogleSignIn extends GoogleSignInPlatform {
}

@override
Future<void> clearAuthCache({String? token}) {
Future<void> clearAuthCache({required String token}) {
return channel.invokeMethod<void>(
'clearAuthCache',
<String, String?>{'token': token},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_sign_i
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.4.3
version: 2.4.4

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

0 comments on commit ece0d7b

Please sign in to comment.