diff --git a/packages/google_sign_in/google_sign_in_android/CHANGELOG.md b/packages/google_sign_in/google_sign_in_android/CHANGELOG.md index 2e30337e7764..35af262af528 100644 --- a/packages/google_sign_in/google_sign_in_android/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.33 + +* Updates Pigeon for non-nullable collection type support. + ## 6.1.32 * Updates Java compatibility version to 11. diff --git a/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java b/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java index c3f03ab2e90e..301642bce1e8 100644 --- a/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java +++ b/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java @@ -56,13 +56,13 @@ public void initInstance( @NonNull GoogleSignInWrapper googleSignInWrapper) { this.messenger = messenger; delegate = new Delegate(context, googleSignInWrapper); - GoogleSignInApi.setup(messenger, delegate); + GoogleSignInApi.setUp(messenger, delegate); } private void dispose() { delegate = null; if (messenger != null) { - GoogleSignInApi.setup(messenger, null); + GoogleSignInApi.setUp(messenger, null); messenger = null; } } @@ -241,6 +241,30 @@ void requestScopes( final @NonNull MethodChannel.Result result, final @NonNull List scopes); } + /** + * Helper class for supporting the legacy IDelegate interface based on raw method channels, which + * handles converting any FlutterErrors (or other {@code Throwable}s in case any non- FlutterError + * exceptions slip through) thrown by the new code paths into {@code error} callbacks. + */ + private abstract static class ErrorConvertingMethodChannelVoidResult + implements Messages.VoidResult { + final @NonNull MethodChannel.Result result; + + public ErrorConvertingMethodChannelVoidResult(@NonNull MethodChannel.Result result) { + this.result = result; + } + + @Override + public void error(@NonNull Throwable error) { + if (error instanceof FlutterError) { + FlutterError flutterError = (FlutterError) error; + result.error(flutterError.code, flutterError.getMessage(), flutterError.details); + } else { + result.error("exception", error.getMessage(), null); + } + } + } + /** * Helper class for supporting the legacy IDelegate interface based on raw method channels, which * handles converting any FlutterErrors (or other {@code Throwable}s in case any non- FlutterError @@ -296,13 +320,13 @@ public void success(Messages.UserData data) { * Helper class for supporting the legacy IDelegate interface based on raw method channels, which * handles converting responses from methods that return {@code Void}. */ - private static class VoidMethodChannelResult extends ErrorConvertingMethodChannelResult { + private static class VoidMethodChannelResult extends ErrorConvertingMethodChannelVoidResult { public VoidMethodChannelResult(MethodChannel.Result result) { super(result); } @Override - public void success(Void unused) { + public void success() { result.success(null); } } @@ -367,7 +391,7 @@ public void setActivity(@Nullable Activity activity) { private void checkAndSetPendingOperation( String method, Messages.Result userDataResult, - Messages.Result voidResult, + Messages.VoidResult voidResult, Messages.Result boolResult, Messages.Result stringResult, Object data) { @@ -385,7 +409,7 @@ private void checkAndSetPendingSignInOperation( } private void checkAndSetPendingVoidOperation( - String method, @NonNull Messages.Result result) { + String method, @NonNull Messages.VoidResult result) { checkAndSetPendingOperation(method, null, result, null, null, null); } @@ -557,7 +581,7 @@ public void signIn(@NonNull MethodChannel.Result result) { * sign back in. */ @Override - public void signOut(@NonNull Messages.Result result) { + public void signOut(@NonNull Messages.VoidResult result) { checkAndSetPendingVoidOperation("signOut", result); signInClient @@ -580,7 +604,7 @@ public void signOut(@NonNull MethodChannel.Result result) { /** Signs the user out, and revokes their credentials. */ @Override - public void disconnect(@NonNull Messages.Result result) { + public void disconnect(@NonNull Messages.VoidResult result) { checkAndSetPendingVoidOperation("disconnect", result); signInClient @@ -705,7 +729,7 @@ private String errorCodeForStatus(int statusCode) { } private void finishWithSuccess() { - Objects.requireNonNull(pendingOperation.voidResult).success(null); + Objects.requireNonNull(pendingOperation.voidResult).success(); pendingOperation = null; } @@ -720,24 +744,27 @@ private void finishWithUserData(Messages.UserData data) { } private void finishWithError(String errorCode, String errorMessage) { - Messages.Result result; - if (pendingOperation.userDataResult != null) { - result = pendingOperation.userDataResult; - } else if (pendingOperation.boolResult != null) { - result = pendingOperation.boolResult; - } else if (pendingOperation.stringResult != null) { - result = pendingOperation.stringResult; + if (pendingOperation.voidResult != null) { + Objects.requireNonNull(pendingOperation.voidResult) + .error(new FlutterError(errorCode, errorMessage, null)); } else { - result = pendingOperation.voidResult; + Messages.Result result; + if (pendingOperation.userDataResult != null) { + result = pendingOperation.userDataResult; + } else if (pendingOperation.boolResult != null) { + result = pendingOperation.boolResult; + } else { + result = pendingOperation.stringResult; + } + Objects.requireNonNull(result).error(new FlutterError(errorCode, errorMessage, null)); } - Objects.requireNonNull(result).error(new FlutterError(errorCode, errorMessage, null)); pendingOperation = null; } private static class PendingOperation { final @NonNull String method; final @Nullable Messages.Result userDataResult; - final @Nullable Messages.Result voidResult; + final @Nullable Messages.VoidResult voidResult; final @Nullable Messages.Result boolResult; final @Nullable Messages.Result stringResult; final @Nullable Object data; @@ -745,7 +772,7 @@ private static class PendingOperation { PendingOperation( @NonNull String method, @Nullable Messages.Result userDataResult, - @Nullable Messages.Result voidResult, + @Nullable Messages.VoidResult voidResult, @Nullable Messages.Result boolResult, @Nullable Messages.Result stringResult, @Nullable Object data) { @@ -764,7 +791,7 @@ private static class PendingOperation { /** Clears the token kept in the client side cache. */ @Override - public void clearAuthCache(@NonNull String token, @NonNull Messages.Result result) { + public void clearAuthCache(@NonNull String token, @NonNull Messages.VoidResult result) { Callable clearTokenTask = () -> { GoogleAuthUtil.clearToken(context, token); @@ -775,7 +802,8 @@ public void clearAuthCache(@NonNull String token, @NonNull Messages.Result clearTokenTask, clearTokenFuture -> { try { - result.success(clearTokenFuture.get()); + clearTokenFuture.get(); + result.success(); } catch (ExecutionException e) { @Nullable Throwable cause = e.getCause(); result.error( diff --git a/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/Messages.java b/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/Messages.java index aa94bbbf7244..2bf6b6c1e06a 100644 --- a/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/Messages.java +++ b/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/Messages.java @@ -1,11 +1,14 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v10.1.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.googlesignin; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.CLASS; + import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -14,9 +17,12 @@ import io.flutter.plugin.common.MessageCodec; import io.flutter.plugin.common.StandardMessageCodec; import java.io.ByteArrayOutputStream; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; +import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -40,7 +46,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -55,6 +61,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { return errorList; } + @Target(METHOD) + @Retention(CLASS) + @interface CanIgnoreReturnValue {} + /** Pigeon version of SignInOption. */ public enum SignInType { /** Default configuration. */ @@ -64,7 +74,7 @@ public enum SignInType { final int index; - private SignInType(final int index) { + SignInType(final int index) { this.index = index; } } @@ -149,10 +159,34 @@ public void setForceCodeForRefreshToken(@NonNull Boolean setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ InitParams() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InitParams that = (InitParams) o; + return scopes.equals(that.scopes) + && signInType.equals(that.signInType) + && Objects.equals(hostedDomain, that.hostedDomain) + && Objects.equals(clientId, that.clientId) + && Objects.equals(serverClientId, that.serverClientId) + && forceCodeForRefreshToken.equals(that.forceCodeForRefreshToken); + } + + @Override + public int hashCode() { + return Objects.hash( + scopes, signInType, hostedDomain, clientId, serverClientId, forceCodeForRefreshToken); + } + public static final class Builder { private @Nullable List scopes; + @CanIgnoreReturnValue public @NonNull Builder setScopes(@NonNull List setterArg) { this.scopes = setterArg; return this; @@ -160,6 +194,7 @@ public static final class Builder { private @Nullable SignInType signInType; + @CanIgnoreReturnValue public @NonNull Builder setSignInType(@NonNull SignInType setterArg) { this.signInType = setterArg; return this; @@ -167,6 +202,7 @@ public static final class Builder { private @Nullable String hostedDomain; + @CanIgnoreReturnValue public @NonNull Builder setHostedDomain(@Nullable String setterArg) { this.hostedDomain = setterArg; return this; @@ -174,6 +210,7 @@ public static final class Builder { private @Nullable String clientId; + @CanIgnoreReturnValue public @NonNull Builder setClientId(@Nullable String setterArg) { this.clientId = setterArg; return this; @@ -181,6 +218,7 @@ public static final class Builder { private @Nullable String serverClientId; + @CanIgnoreReturnValue public @NonNull Builder setServerClientId(@Nullable String setterArg) { this.serverClientId = setterArg; return this; @@ -188,6 +226,7 @@ public static final class Builder { private @Nullable Boolean forceCodeForRefreshToken; + @CanIgnoreReturnValue public @NonNull Builder setForceCodeForRefreshToken(@NonNull Boolean setterArg) { this.forceCodeForRefreshToken = setterArg; return this; @@ -207,9 +246,9 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(6); + ArrayList toListResult = new ArrayList<>(6); toListResult.add(scopes); - toListResult.add(signInType == null ? null : signInType.index); + toListResult.add(signInType); toListResult.add(hostedDomain); toListResult.add(clientId); toListResult.add(serverClientId); @@ -217,19 +256,19 @@ ArrayList toList() { return toListResult; } - static @NonNull InitParams fromList(@NonNull ArrayList list) { + static @NonNull InitParams fromList(@NonNull ArrayList pigeonVar_list) { InitParams pigeonResult = new InitParams(); - Object scopes = list.get(0); + Object scopes = pigeonVar_list.get(0); pigeonResult.setScopes((List) scopes); - Object signInType = list.get(1); - pigeonResult.setSignInType(signInType == null ? null : SignInType.values()[(int) signInType]); - Object hostedDomain = list.get(2); + Object signInType = pigeonVar_list.get(1); + pigeonResult.setSignInType((SignInType) signInType); + Object hostedDomain = pigeonVar_list.get(2); pigeonResult.setHostedDomain((String) hostedDomain); - Object clientId = list.get(3); + Object clientId = pigeonVar_list.get(3); pigeonResult.setClientId((String) clientId); - Object serverClientId = list.get(4); + Object serverClientId = pigeonVar_list.get(4); pigeonResult.setServerClientId((String) serverClientId); - Object forceCodeForRefreshToken = list.get(5); + Object forceCodeForRefreshToken = pigeonVar_list.get(5); pigeonResult.setForceCodeForRefreshToken((Boolean) forceCodeForRefreshToken); return pigeonResult; } @@ -312,10 +351,33 @@ public void setServerAuthCode(@Nullable String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ UserData() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserData that = (UserData) o; + return Objects.equals(displayName, that.displayName) + && email.equals(that.email) + && id.equals(that.id) + && Objects.equals(photoUrl, that.photoUrl) + && Objects.equals(idToken, that.idToken) + && Objects.equals(serverAuthCode, that.serverAuthCode); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, email, id, photoUrl, idToken, serverAuthCode); + } + public static final class Builder { private @Nullable String displayName; + @CanIgnoreReturnValue public @NonNull Builder setDisplayName(@Nullable String setterArg) { this.displayName = setterArg; return this; @@ -323,6 +385,7 @@ public static final class Builder { private @Nullable String email; + @CanIgnoreReturnValue public @NonNull Builder setEmail(@NonNull String setterArg) { this.email = setterArg; return this; @@ -330,6 +393,7 @@ public static final class Builder { private @Nullable String id; + @CanIgnoreReturnValue public @NonNull Builder setId(@NonNull String setterArg) { this.id = setterArg; return this; @@ -337,6 +401,7 @@ public static final class Builder { private @Nullable String photoUrl; + @CanIgnoreReturnValue public @NonNull Builder setPhotoUrl(@Nullable String setterArg) { this.photoUrl = setterArg; return this; @@ -344,6 +409,7 @@ public static final class Builder { private @Nullable String idToken; + @CanIgnoreReturnValue public @NonNull Builder setIdToken(@Nullable String setterArg) { this.idToken = setterArg; return this; @@ -351,6 +417,7 @@ public static final class Builder { private @Nullable String serverAuthCode; + @CanIgnoreReturnValue public @NonNull Builder setServerAuthCode(@Nullable String setterArg) { this.serverAuthCode = setterArg; return this; @@ -370,7 +437,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(6); + ArrayList toListResult = new ArrayList<>(6); toListResult.add(displayName); toListResult.add(email); toListResult.add(id); @@ -380,42 +447,40 @@ ArrayList toList() { return toListResult; } - static @NonNull UserData fromList(@NonNull ArrayList list) { + static @NonNull UserData fromList(@NonNull ArrayList pigeonVar_list) { UserData pigeonResult = new UserData(); - Object displayName = list.get(0); + Object displayName = pigeonVar_list.get(0); pigeonResult.setDisplayName((String) displayName); - Object email = list.get(1); + Object email = pigeonVar_list.get(1); pigeonResult.setEmail((String) email); - Object id = list.get(2); + Object id = pigeonVar_list.get(2); pigeonResult.setId((String) id); - Object photoUrl = list.get(3); + Object photoUrl = pigeonVar_list.get(3); pigeonResult.setPhotoUrl((String) photoUrl); - Object idToken = list.get(4); + Object idToken = pigeonVar_list.get(4); pigeonResult.setIdToken((String) idToken); - Object serverAuthCode = list.get(5); + Object serverAuthCode = pigeonVar_list.get(5); pigeonResult.setServerAuthCode((String) serverAuthCode); return pigeonResult; } } - public interface Result { - @SuppressWarnings("UnknownNullness") - void success(T result); + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - void error(@NonNull Throwable error); - } - - private static class GoogleSignInApiCodec extends StandardMessageCodec { - public static final GoogleSignInApiCodec INSTANCE = new GoogleSignInApiCodec(); - - private GoogleSignInApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return InitParams.fromList((ArrayList) readValue(buffer)); case (byte) 129: + { + Object value = readValue(buffer); + return value == null ? null : SignInType.values()[((Long) value).intValue()]; + } + case (byte) 130: + return InitParams.fromList((ArrayList) readValue(buffer)); + case (byte) 131: return UserData.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); @@ -424,11 +489,14 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof InitParams) { - stream.write(128); + if (value instanceof SignInType) { + stream.write(129); + writeValue(stream, value == null ? null : ((SignInType) value).index); + } else if (value instanceof InitParams) { + stream.write(130); writeValue(stream, ((InitParams) value).toList()); } else if (value instanceof UserData) { - stream.write(129); + stream.write(131); writeValue(stream, ((UserData) value).toList()); } else { super.writeValue(stream, value); @@ -436,6 +504,30 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface GoogleSignInApi { /** Initializes a sign in request with the given parameters. */ @@ -448,41 +540,51 @@ public interface GoogleSignInApi { void getAccessToken( @NonNull String email, @NonNull Boolean shouldRecoverAuth, @NonNull Result result); /** Signs out the current user. */ - void signOut(@NonNull Result result); + void signOut(@NonNull VoidResult result); /** Revokes scope grants to the application. */ - void disconnect(@NonNull Result result); + void disconnect(@NonNull VoidResult result); /** Returns whether the user is currently signed in. */ @NonNull Boolean isSignedIn(); /** Clears the authentication caching for the given token, requiring a new sign in. */ - void clearAuthCache(@NonNull String token, @NonNull Result result); + void clearAuthCache(@NonNull String token, @NonNull VoidResult result); /** Requests access to the given scopes. */ void requestScopes(@NonNull List scopes, @NonNull Result result); /** The codec used by GoogleSignInApi. */ static @NonNull MessageCodec getCodec() { - return GoogleSignInApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `GoogleSignInApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable GoogleSignInApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable GoogleSignInApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable GoogleSignInApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.init", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.init" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; InitParams paramsArg = (InitParams) args.get(0); try { api.init(paramsArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -493,11 +595,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable GoogleSign { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.signInSilently", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signInSilently" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success(UserData result) { @@ -520,11 +625,14 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.signIn", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signIn" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success(UserData result) { @@ -547,11 +655,14 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.getAccessToken", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.getAccessToken" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String emailArg = (String) args.get(0); Boolean shouldRecoverAuthArg = (Boolean) args.get(1); @@ -577,14 +688,17 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.signOut", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signOut" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); - Result resultCallback = - new Result() { - public void success(Void result) { + ArrayList wrapped = new ArrayList<>(); + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -604,14 +718,17 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.disconnect", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.disconnect" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); - Result resultCallback = - new Result() { - public void success(Void result) { + ArrayList wrapped = new ArrayList<>(); + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -631,17 +748,19 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.isSignedIn", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.isSignedIn" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isSignedIn(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -652,16 +771,19 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.clearAuthCache", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.clearAuthCache" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String tokenArg = (String) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -681,11 +803,14 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.requestScopes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.requestScopes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List scopesArg = (List) args.get(0); Result resultCallback = diff --git a/packages/google_sign_in/google_sign_in_android/android/src/test/java/io/flutter/plugins/googlesignin/GoogleSignInTest.java b/packages/google_sign_in/google_sign_in_android/android/src/test/java/io/flutter/plugins/googlesignin/GoogleSignInTest.java index 6089a81b3547..45dbae355008 100644 --- a/packages/google_sign_in/google_sign_in_android/android/src/test/java/io/flutter/plugins/googlesignin/GoogleSignInTest.java +++ b/packages/google_sign_in/google_sign_in_android/android/src/test/java/io/flutter/plugins/googlesignin/GoogleSignInTest.java @@ -41,7 +41,7 @@ public class GoogleSignInTest { @Mock Resources mockResources; @Mock Activity mockActivity; @Mock BinaryMessenger mockMessenger; - @Spy Messages.Result voidResult; + @Spy Messages.VoidResult voidResult; @Spy Messages.Result boolResult; @Spy Messages.Result userDataResult; @Mock GoogleSignInWrapper mockGoogleSignIn; diff --git a/packages/google_sign_in/google_sign_in_android/lib/src/messages.g.dart b/packages/google_sign_in/google_sign_in_android/lib/src/messages.g.dart index 14d8cb5fdc90..c5a7367318cd 100644 --- a/packages/google_sign_in/google_sign_in_android/lib/src/messages.g.dart +++ b/packages/google_sign_in/google_sign_in_android/lib/src/messages.g.dart @@ -1,9 +1,9 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v10.1.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,6 +11,13 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + /// Pigeon version of SignInOption. enum SignInType { /// Default configuration. @@ -25,15 +32,15 @@ enum SignInType { /// See SignInInitParams for details. class InitParams { InitParams({ - required this.scopes, - required this.signInType, + this.scopes = const [], + this.signInType = SignInType.standard, this.hostedDomain, this.clientId, this.serverClientId, - required this.forceCodeForRefreshToken, + this.forceCodeForRefreshToken = false, }); - List scopes; + List scopes; SignInType signInType; @@ -48,7 +55,7 @@ class InitParams { Object encode() { return [ scopes, - signInType.index, + signInType, hostedDomain, clientId, serverClientId, @@ -59,8 +66,8 @@ class InitParams { static InitParams decode(Object result) { result as List; return InitParams( - scopes: (result[0] as List?)!.cast(), - signInType: SignInType.values[result[1]! as int], + scopes: (result[0] as List?)!.cast(), + signInType: result[1]! as SignInType, hostedDomain: result[2] as String?, clientId: result[3] as String?, serverClientId: result[4] as String?, @@ -118,15 +125,21 @@ class UserData { } } -class _GoogleSignInApiCodec extends StandardMessageCodec { - const _GoogleSignInApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is InitParams) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SignInType) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is InitParams) { + buffer.putUint8(130); writeValue(buffer, value.encode()); } else if (value is UserData) { - buffer.putUint8(129); + buffer.putUint8(131); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -136,9 +149,12 @@ class _GoogleSignInApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return InitParams.decode(readValue(buffer)!); case 129: + final int? value = readValue(buffer) as int?; + return value == null ? null : SignInType.values[value]; + case 130: + return InitParams.decode(readValue(buffer)!); + case 131: return UserData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -150,29 +166,36 @@ class GoogleSignInApi { /// Constructor for [GoogleSignInApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - GoogleSignInApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + GoogleSignInApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec codec = _GoogleSignInApiCodec(); + final String pigeonVar_messageChannelSuffix; /// Initializes a sign in request with the given parameters. - Future init(InitParams arg_params) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.init', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_params]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future init(InitParams params) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.init$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([params]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -181,103 +204,113 @@ class GoogleSignInApi { /// Starts a silent sign in. Future signInSilently() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.signInSilently', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signInSilently$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as UserData?)!; + return (pigeonVar_replyList[0] as UserData?)!; } } /// Starts a sign in with user interaction. Future signIn() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.signIn', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signIn$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as UserData?)!; + return (pigeonVar_replyList[0] as UserData?)!; } } /// Requests the access token for the current sign in. - Future getAccessToken( - String arg_email, bool arg_shouldRecoverAuth) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.getAccessToken', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_email, arg_shouldRecoverAuth]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future getAccessToken(String email, bool shouldRecoverAuth) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.getAccessToken$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([email, shouldRecoverAuth]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as String?)!; + return (pigeonVar_replyList[0] as String?)!; } } /// Signs out the current user. Future signOut() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.signOut', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signOut$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -286,20 +319,23 @@ class GoogleSignInApi { /// Revokes scope grants to the application. Future disconnect() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.disconnect', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.disconnect$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -308,49 +344,54 @@ class GoogleSignInApi { /// Returns whether the user is currently signed in. Future isSignedIn() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.isSignedIn', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.isSignedIn$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } /// Clears the authentication caching for the given token, requiring a /// new sign in. - Future clearAuthCache(String arg_token) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.clearAuthCache', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_token]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future clearAuthCache(String token) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.clearAuthCache$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([token]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -358,30 +399,32 @@ class GoogleSignInApi { } /// Requests access to the given scopes. - Future requestScopes(List arg_scopes) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.requestScopes', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_scopes]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future requestScopes(List scopes) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.requestScopes$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([scopes]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } } diff --git a/packages/google_sign_in/google_sign_in_android/pigeons/messages.dart b/packages/google_sign_in/google_sign_in_android/pigeons/messages.dart index 4804d43eac5c..69a452277dfe 100644 --- a/packages/google_sign_in/google_sign_in_android/pigeons/messages.dart +++ b/packages/google_sign_in/google_sign_in_android/pigeons/messages.dart @@ -35,10 +35,7 @@ class InitParams { this.forceCodeForRefreshToken = false, }); - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The Java code treats the values as non-nullable. - final List scopes; + final List scopes; final SignInType signInType; final String? hostedDomain; final String? clientId; diff --git a/packages/google_sign_in/google_sign_in_android/pubspec.yaml b/packages/google_sign_in/google_sign_in_android/pubspec.yaml index 86a96c70db4a..598eeb91a9df 100644 --- a/packages/google_sign_in/google_sign_in_android/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_android/pubspec.yaml @@ -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.32 +version: 6.1.33 environment: sdk: ^3.5.0 @@ -29,7 +29,7 @@ dev_dependencies: integration_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^10.1.0 + pigeon: ^22.4.2 topics: - authentication diff --git a/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md b/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md index 285af4a4bc26..d6ab31e98763 100644 --- a/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.7.8 + +* Updates Pigeon for non-nullable collection type support. + ## 5.7.7 * Fixes "callee requires a non-null parameter" analyzer warning. diff --git a/packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart b/packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart index c540ee7b60f8..822d06a03a2d 100644 --- a/packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart +++ b/packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart @@ -24,10 +24,7 @@ class InitParams { this.serverClientId, }); - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The Obj-C code treats the values as non-nullable. - final List scopes; + final List scopes; final String? hostedDomain; final String? clientId; final String? serverClientId; diff --git a/packages/google_sign_in/google_sign_in_ios/pubspec.yaml b/packages/google_sign_in/google_sign_in_ios/pubspec.yaml index 12f17274e395..b4d782f97a98 100644 --- a/packages/google_sign_in/google_sign_in_ios/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_ios/pubspec.yaml @@ -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.7 +version: 5.7.8 environment: sdk: ^3.3.0 @@ -33,7 +33,7 @@ dev_dependencies: integration_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^11.0.1 + pigeon: ^22.4.2 topics: - authentication