Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## NEXT
## 3.1.0

* Adds a `clearAuthorizationToken` method to remove an access token from the
cache.
* Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.

## 3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ abstract class GoogleSignInPlatform extends PlatformInterface {
ServerAuthorizationTokensForScopesParameters params,
);

/// Clears any token cache for the given access token.
Future<void> clearAuthorizationToken(ClearAuthorizationTokenParams params) {
throw UnimplementedError(
'clearAuthorizationToken() has not been implemented.',
);
}

/// Signs out previously signed in accounts.
Future<void> signOut(SignOutParams params);

Expand Down Expand Up @@ -168,6 +175,11 @@ class _PlaceholderImplementation extends GoogleSignInPlatform {
throw UnimplementedError();
}

@override
Future<void> clearAuthorizationToken(ClearAuthorizationTokenParams params) {
throw UnimplementedError();
}

@override
Future<void> signOut(SignOutParams params) {
throw UnimplementedError();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,29 @@ class AuthenticationResults {
final AuthenticationTokenData authenticationTokens;
}

/// Parameters for the clearAuthorizationToken method.
@immutable
class ClearAuthorizationTokenParams {
/// Creates new parameters for clearAuthorizationToken with the given
/// [accessToken]
const ClearAuthorizationTokenParams({required this.accessToken});

/// The OAuth2 access token to clear.
final String accessToken;

@override
int get hashCode => accessToken.hashCode;

@override
bool operator ==(Object other) {
if (other.runtimeType != runtimeType) {
return false;
}
return other is ClearAuthorizationTokenParams &&
other.accessToken == accessToken;
}
}

/// Parameters for the signOut method.
@immutable
class SignOutParams {
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: 3.0.0
version: 3.1.0

environment:
sdk: ^3.7.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ void main() {
// this behavior, which could be implemented in the subclass.
expect(ExtendsGoogleSignInPlatform().authenticationEvents, null);
});

test(
'Default implementation of clearAuthorizationToken throws unimplemented error',
() {
final ExtendsGoogleSignInPlatform platform =
ExtendsGoogleSignInPlatform();

expect(
() => platform.clearAuthorizationToken(
const ClearAuthorizationTokenParams(accessToken: 'someToken'),
),
throwsUnimplementedError,
);
},
);
});

group('GoogleSignInUserData', () {
Expand Down
Empty file modified script/tool/bin/flutter_plugin_tools.dart
100644 → 100755
Empty file.