formatting
diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java index d9f8381..256e957 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java
@@ -4,10 +4,10 @@ package io.flutter.plugins.inapppurchase; -import static io.flutter.plugins.inapppurchase.TranslatorKt.fromInAppMessageResult; import static io.flutter.plugins.inapppurchase.TranslatorKt.fromAlternativeBillingOnlyReportingDetails; import static io.flutter.plugins.inapppurchase.TranslatorKt.fromBillingConfig; import static io.flutter.plugins.inapppurchase.TranslatorKt.fromBillingResult; +import static io.flutter.plugins.inapppurchase.TranslatorKt.fromInAppMessageResult; import static io.flutter.plugins.inapppurchase.TranslatorKt.fromProductDetailsList; import static io.flutter.plugins.inapppurchase.TranslatorKt.fromPurchaseHistoryRecordList; import static io.flutter.plugins.inapppurchase.TranslatorKt.fromPurchasesList; @@ -37,15 +37,13 @@ import com.android.billingclient.api.QueryProductDetailsParams; import com.android.billingclient.api.QueryPurchaseHistoryParams; import com.android.billingclient.api.QueryPurchasesParams; - -import org.jetbrains.annotations.NotNull; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import kotlin.Result; import kotlin.Unit; import kotlin.jvm.functions.Function1; +import org.jetbrains.annotations.NotNull; /** Handles method channel for the plugin. */ class MethodCallHandlerImpl implements Application.ActivityLifecycleCallbacks, InAppPurchaseApi { @@ -179,24 +177,29 @@ } @Override - public void showInAppMessages(@NotNull Function1<? super @NotNull Result<@NotNull PlatformInAppMessageResult>, @NotNull Unit> callback) { + public void showInAppMessages( + @NotNull + Function1<? super @NotNull Result<@NotNull PlatformInAppMessageResult>, @NotNull Unit> + callback) { if (billingClient == null) { ResultUtilsKt.completeWithError(callback, getNullBillingClientError()); return; } if (activity == null) { - ResultUtilsKt.completeWithError(callback, new FlutterError(ACTIVITY_UNAVAILABLE, "Not attempting to show dialog", null)); + ResultUtilsKt.completeWithError( + callback, new FlutterError(ACTIVITY_UNAVAILABLE, "Not attempting to show dialog", null)); return; } try { InAppMessageParams params = InAppMessageParams.newBuilder().addAllInAppMessageCategoriesToShow().build(); billingClient.showInAppMessages( - activity, params, - (billingResult) -> - ResultCompat.success(fromInAppMessageResult(billingResult), callback)); + activity, + params, + (billingResult) -> ResultCompat.success(fromInAppMessageResult(billingResult), callback)); } catch (RuntimeException e) { - ResultUtilsKt.completeWithError(callback, new FlutterError("error", e.getMessage(), Log.getStackTraceString(e))); + ResultUtilsKt.completeWithError( + callback, new FlutterError("error", e.getMessage(), Log.getStackTraceString(e))); } }
diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/kotlin/io/flutter/plugins/inapppurchase/Messages.kt b/packages/in_app_purchase/in_app_purchase_android/android/src/main/kotlin/io/flutter/plugins/inapppurchase/Messages.kt index 2fb1814..0fd2d2c 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/kotlin/io/flutter/plugins/inapppurchase/Messages.kt +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/kotlin/io/flutter/plugins/inapppurchase/Messages.kt
@@ -10,16 +10,17 @@ import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger -import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MessageCodec -import io.flutter.plugin.common.StandardMethodCodec import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer + private object MessagesPigeonUtils { fun createConnectionError(channelName: String): FlutterError { - return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "") } + return FlutterError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") + } fun wrapResult(result: Any?): List<Any?> { return listOf(result) @@ -27,19 +28,15 @@ fun wrapError(exception: Throwable): List<Any?> { return if (exception is FlutterError) { - listOf( - exception.code, - exception.message, - exception.details - ) + listOf(exception.code, exception.message, exception.details) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) - ) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) } } + fun doubleEquals(a: Double, b: Double): Boolean { // Normalize -0.0 to 0.0 and handle NaN equality. return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) @@ -183,19 +180,19 @@ else -> value.hashCode() } } - } /** * Error class for passing custom error details to Flutter via a thrown PlatformException. + * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class FlutterError ( - val code: String, - override val message: String? = null, - val details: Any? = null +class FlutterError( + val code: String, + override val message: String? = null, + val details: Any? = null ) : RuntimeException() /** Pigeon version of Java BillingClient.BillingResponseCode. */ @@ -226,16 +223,16 @@ /** * The flow has finished and there is no action needed from developers. * - * Note: The API callback won't indicate whether message is dismissed by the - * user or there is no message available to the user. + * Note: The API callback won't indicate whether message is dismissed by the user or there is no + * message available to the user. */ NO_ACTION_NEEDED(0), /** * The subscription status changed. * - * For example, a subscription has been recovered from a suspended state. - * Developers should expect the purchase token to be returned with this - * response code and use the purchase token with the Google Play Developer API. + * For example, a subscription has been recovered from a suspended state. Developers should expect + * the purchase token to be returned with this response code and use the purchase token with the + * Google Play Developer API. */ SUBSCRIPTION_STATUS_UPDATED(1); @@ -342,11 +339,7 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformQueryProduct ( - val productId: String, - val productType: PlatformProductType -) - { +data class PlatformQueryProduct(val productId: String, val productType: PlatformProductType) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformQueryProduct { val productId = pigeonVar_list[0] as String @@ -354,12 +347,14 @@ return PlatformQueryProduct(productId, productType) } } + fun toList(): List<Any?> { return listOf( - productId, - productType, + productId, + productType, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -368,7 +363,8 @@ return true } val other = other as PlatformQueryProduct - return MessagesPigeonUtils.deepEquals(this.productId, other.productId) && MessagesPigeonUtils.deepEquals(this.productType, other.productType) + return MessagesPigeonUtils.deepEquals(this.productId, other.productId) && + MessagesPigeonUtils.deepEquals(this.productType, other.productType) } override fun hashCode(): Int { @@ -384,11 +380,10 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformAccountIdentifiers ( - val obfuscatedAccountId: String? = null, - val obfuscatedProfileId: String? = null -) - { +data class PlatformAccountIdentifiers( + val obfuscatedAccountId: String? = null, + val obfuscatedProfileId: String? = null +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformAccountIdentifiers { val obfuscatedAccountId = pigeonVar_list[0] as String? @@ -396,12 +391,14 @@ return PlatformAccountIdentifiers(obfuscatedAccountId, obfuscatedProfileId) } } + fun toList(): List<Any?> { return listOf( - obfuscatedAccountId, - obfuscatedProfileId, + obfuscatedAccountId, + obfuscatedProfileId, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -410,7 +407,8 @@ return true } val other = other as PlatformAccountIdentifiers - return MessagesPigeonUtils.deepEquals(this.obfuscatedAccountId, other.obfuscatedAccountId) && MessagesPigeonUtils.deepEquals(this.obfuscatedProfileId, other.obfuscatedProfileId) + return MessagesPigeonUtils.deepEquals(this.obfuscatedAccountId, other.obfuscatedAccountId) && + MessagesPigeonUtils.deepEquals(this.obfuscatedProfileId, other.obfuscatedProfileId) } override fun hashCode(): Int { @@ -426,11 +424,10 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformBillingResult ( - val responseCode: PlatformBillingResponse, - val debugMessage: String -) - { +data class PlatformBillingResult( + val responseCode: PlatformBillingResponse, + val debugMessage: String +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformBillingResult { val responseCode = pigeonVar_list[0] as PlatformBillingResponse @@ -438,12 +435,14 @@ return PlatformBillingResult(responseCode, debugMessage) } } + fun toList(): List<Any?> { return listOf( - responseCode, - debugMessage, + responseCode, + debugMessage, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -452,7 +451,8 @@ return true } val other = other as PlatformBillingResult - return MessagesPigeonUtils.deepEquals(this.responseCode, other.responseCode) && MessagesPigeonUtils.deepEquals(this.debugMessage, other.debugMessage) + return MessagesPigeonUtils.deepEquals(this.responseCode, other.responseCode) && + MessagesPigeonUtils.deepEquals(this.debugMessage, other.debugMessage) } override fun hashCode(): Int { @@ -468,27 +468,29 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformOneTimePurchaseOfferDetails ( - val priceAmountMicros: Long, - val formattedPrice: String, - val priceCurrencyCode: String -) - { +data class PlatformOneTimePurchaseOfferDetails( + val priceAmountMicros: Long, + val formattedPrice: String, + val priceCurrencyCode: String +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformOneTimePurchaseOfferDetails { val priceAmountMicros = pigeonVar_list[0] as Long val formattedPrice = pigeonVar_list[1] as String val priceCurrencyCode = pigeonVar_list[2] as String - return PlatformOneTimePurchaseOfferDetails(priceAmountMicros, formattedPrice, priceCurrencyCode) + return PlatformOneTimePurchaseOfferDetails( + priceAmountMicros, formattedPrice, priceCurrencyCode) } } + fun toList(): List<Any?> { return listOf( - priceAmountMicros, - formattedPrice, - priceCurrencyCode, + priceAmountMicros, + formattedPrice, + priceCurrencyCode, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -497,7 +499,9 @@ return true } val other = other as PlatformOneTimePurchaseOfferDetails - return MessagesPigeonUtils.deepEquals(this.priceAmountMicros, other.priceAmountMicros) && MessagesPigeonUtils.deepEquals(this.formattedPrice, other.formattedPrice) && MessagesPigeonUtils.deepEquals(this.priceCurrencyCode, other.priceCurrencyCode) + return MessagesPigeonUtils.deepEquals(this.priceAmountMicros, other.priceAmountMicros) && + MessagesPigeonUtils.deepEquals(this.formattedPrice, other.formattedPrice) && + MessagesPigeonUtils.deepEquals(this.priceCurrencyCode, other.priceCurrencyCode) } override fun hashCode(): Int { @@ -514,16 +518,15 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformProductDetails ( - val description: String, - val name: String, - val productId: String, - val productType: PlatformProductType, - val title: String, - val oneTimePurchaseOfferDetails: PlatformOneTimePurchaseOfferDetails? = null, - val subscriptionOfferDetails: List<PlatformSubscriptionOfferDetails>? = null -) - { +data class PlatformProductDetails( + val description: String, + val name: String, + val productId: String, + val productType: PlatformProductType, + val title: String, + val oneTimePurchaseOfferDetails: PlatformOneTimePurchaseOfferDetails? = null, + val subscriptionOfferDetails: List<PlatformSubscriptionOfferDetails>? = null +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformProductDetails { val description = pigeonVar_list[0] as String @@ -533,20 +536,29 @@ val title = pigeonVar_list[4] as String val oneTimePurchaseOfferDetails = pigeonVar_list[5] as PlatformOneTimePurchaseOfferDetails? val subscriptionOfferDetails = pigeonVar_list[6] as List<PlatformSubscriptionOfferDetails>? - return PlatformProductDetails(description, name, productId, productType, title, oneTimePurchaseOfferDetails, subscriptionOfferDetails) + return PlatformProductDetails( + description, + name, + productId, + productType, + title, + oneTimePurchaseOfferDetails, + subscriptionOfferDetails) } } + fun toList(): List<Any?> { return listOf( - description, - name, - productId, - productType, - title, - oneTimePurchaseOfferDetails, - subscriptionOfferDetails, + description, + name, + productId, + productType, + title, + oneTimePurchaseOfferDetails, + subscriptionOfferDetails, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -555,7 +567,15 @@ return true } val other = other as PlatformProductDetails - return MessagesPigeonUtils.deepEquals(this.description, other.description) && MessagesPigeonUtils.deepEquals(this.name, other.name) && MessagesPigeonUtils.deepEquals(this.productId, other.productId) && MessagesPigeonUtils.deepEquals(this.productType, other.productType) && MessagesPigeonUtils.deepEquals(this.title, other.title) && MessagesPigeonUtils.deepEquals(this.oneTimePurchaseOfferDetails, other.oneTimePurchaseOfferDetails) && MessagesPigeonUtils.deepEquals(this.subscriptionOfferDetails, other.subscriptionOfferDetails) + return MessagesPigeonUtils.deepEquals(this.description, other.description) && + MessagesPigeonUtils.deepEquals(this.name, other.name) && + MessagesPigeonUtils.deepEquals(this.productId, other.productId) && + MessagesPigeonUtils.deepEquals(this.productType, other.productType) && + MessagesPigeonUtils.deepEquals(this.title, other.title) && + MessagesPigeonUtils.deepEquals( + this.oneTimePurchaseOfferDetails, other.oneTimePurchaseOfferDetails) && + MessagesPigeonUtils.deepEquals( + this.subscriptionOfferDetails, other.subscriptionOfferDetails) } override fun hashCode(): Int { @@ -572,16 +592,15 @@ } /** - * Pigeon version of ProductDetailsResponseWrapper, which contains the - * components of the Java ProductDetailsResponseListener callback. + * Pigeon version of ProductDetailsResponseWrapper, which contains the components of the Java + * ProductDetailsResponseListener callback. * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformProductDetailsResponse ( - val billingResult: PlatformBillingResult, - val productDetails: List<PlatformProductDetails> -) - { +data class PlatformProductDetailsResponse( + val billingResult: PlatformBillingResult, + val productDetails: List<PlatformProductDetails> +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformProductDetailsResponse { val billingResult = pigeonVar_list[0] as PlatformBillingResult @@ -589,12 +608,14 @@ return PlatformProductDetailsResponse(billingResult, productDetails) } } + fun toList(): List<Any?> { return listOf( - billingResult, - productDetails, + billingResult, + productDetails, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -603,7 +624,8 @@ return true } val other = other as PlatformProductDetailsResponse - return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && MessagesPigeonUtils.deepEquals(this.productDetails, other.productDetails) + return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && + MessagesPigeonUtils.deepEquals(this.productDetails, other.productDetails) } override fun hashCode(): Int { @@ -615,30 +637,33 @@ } /** - * Pigeon version of AlternativeBillingOnlyReportingDetailsWrapper, which - * contains the components of the Java - * AlternativeBillingOnlyReportingDetailsListener callback. + * Pigeon version of AlternativeBillingOnlyReportingDetailsWrapper, which contains the components of + * the Java AlternativeBillingOnlyReportingDetailsListener callback. * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformAlternativeBillingOnlyReportingDetailsResponse ( - val billingResult: PlatformBillingResult, - val externalTransactionToken: String -) - { +data class PlatformAlternativeBillingOnlyReportingDetailsResponse( + val billingResult: PlatformBillingResult, + val externalTransactionToken: String +) { companion object { - fun fromList(pigeonVar_list: List<Any?>): PlatformAlternativeBillingOnlyReportingDetailsResponse { + fun fromList( + pigeonVar_list: List<Any?> + ): PlatformAlternativeBillingOnlyReportingDetailsResponse { val billingResult = pigeonVar_list[0] as PlatformBillingResult val externalTransactionToken = pigeonVar_list[1] as String - return PlatformAlternativeBillingOnlyReportingDetailsResponse(billingResult, externalTransactionToken) + return PlatformAlternativeBillingOnlyReportingDetailsResponse( + billingResult, externalTransactionToken) } } + fun toList(): List<Any?> { return listOf( - billingResult, - externalTransactionToken, + billingResult, + externalTransactionToken, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -647,7 +672,9 @@ return true } val other = other as PlatformAlternativeBillingOnlyReportingDetailsResponse - return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && MessagesPigeonUtils.deepEquals(this.externalTransactionToken, other.externalTransactionToken) + return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && + MessagesPigeonUtils.deepEquals( + this.externalTransactionToken, other.externalTransactionToken) } override fun hashCode(): Int { @@ -663,13 +690,12 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformInAppMessageResult ( - /** Returns response code for the in-app messaging API call. */ - val responseCode: PlatformInAppMessageResponse, - /** Returns token that identifies the purchase to be acknowledged, if any. */ - val purchaseToken: String? = null -) - { +data class PlatformInAppMessageResult( + /** Returns response code for the in-app messaging API call. */ + val responseCode: PlatformInAppMessageResponse, + /** Returns token that identifies the purchase to be acknowledged, if any. */ + val purchaseToken: String? = null +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformInAppMessageResult { val responseCode = pigeonVar_list[0] as PlatformInAppMessageResponse @@ -677,12 +703,14 @@ return PlatformInAppMessageResult(responseCode, purchaseToken) } } + fun toList(): List<Any?> { return listOf( - responseCode, - purchaseToken, + responseCode, + purchaseToken, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -691,7 +719,8 @@ return true } val other = other as PlatformInAppMessageResult - return MessagesPigeonUtils.deepEquals(this.responseCode, other.responseCode) && MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) + return MessagesPigeonUtils.deepEquals(this.responseCode, other.responseCode) && + MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) } override fun hashCode(): Int { @@ -703,16 +732,15 @@ } /** - * Pigeon version of BillingConfigWrapper, which contains the components of the - * Java BillingConfigResponseListener callback. + * Pigeon version of BillingConfigWrapper, which contains the components of the Java + * BillingConfigResponseListener callback. * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformBillingConfigResponse ( - val billingResult: PlatformBillingResult, - val countryCode: String -) - { +data class PlatformBillingConfigResponse( + val billingResult: PlatformBillingResult, + val countryCode: String +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformBillingConfigResponse { val billingResult = pigeonVar_list[0] as PlatformBillingResult @@ -720,12 +748,14 @@ return PlatformBillingConfigResponse(billingResult, countryCode) } } + fun toList(): List<Any?> { return listOf( - billingResult, - countryCode, + billingResult, + countryCode, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -734,7 +764,8 @@ return true } val other = other as PlatformBillingConfigResponse - return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && MessagesPigeonUtils.deepEquals(this.countryCode, other.countryCode) + return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && + MessagesPigeonUtils.deepEquals(this.countryCode, other.countryCode) } override fun hashCode(): Int { @@ -750,16 +781,15 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformBillingFlowParams ( - val product: String, - val replacementMode: PlatformReplacementMode, - val offerToken: String? = null, - val accountId: String? = null, - val obfuscatedProfileId: String? = null, - val oldProduct: String? = null, - val purchaseToken: String? = null -) - { +data class PlatformBillingFlowParams( + val product: String, + val replacementMode: PlatformReplacementMode, + val offerToken: String? = null, + val accountId: String? = null, + val obfuscatedProfileId: String? = null, + val oldProduct: String? = null, + val purchaseToken: String? = null +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformBillingFlowParams { val product = pigeonVar_list[0] as String @@ -769,20 +799,29 @@ val obfuscatedProfileId = pigeonVar_list[4] as String? val oldProduct = pigeonVar_list[5] as String? val purchaseToken = pigeonVar_list[6] as String? - return PlatformBillingFlowParams(product, replacementMode, offerToken, accountId, obfuscatedProfileId, oldProduct, purchaseToken) + return PlatformBillingFlowParams( + product, + replacementMode, + offerToken, + accountId, + obfuscatedProfileId, + oldProduct, + purchaseToken) } } + fun toList(): List<Any?> { return listOf( - product, - replacementMode, - offerToken, - accountId, - obfuscatedProfileId, - oldProduct, - purchaseToken, + product, + replacementMode, + offerToken, + accountId, + obfuscatedProfileId, + oldProduct, + purchaseToken, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -791,7 +830,13 @@ return true } val other = other as PlatformBillingFlowParams - return MessagesPigeonUtils.deepEquals(this.product, other.product) && MessagesPigeonUtils.deepEquals(this.replacementMode, other.replacementMode) && MessagesPigeonUtils.deepEquals(this.offerToken, other.offerToken) && MessagesPigeonUtils.deepEquals(this.accountId, other.accountId) && MessagesPigeonUtils.deepEquals(this.obfuscatedProfileId, other.obfuscatedProfileId) && MessagesPigeonUtils.deepEquals(this.oldProduct, other.oldProduct) && MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) + return MessagesPigeonUtils.deepEquals(this.product, other.product) && + MessagesPigeonUtils.deepEquals(this.replacementMode, other.replacementMode) && + MessagesPigeonUtils.deepEquals(this.offerToken, other.offerToken) && + MessagesPigeonUtils.deepEquals(this.accountId, other.accountId) && + MessagesPigeonUtils.deepEquals(this.obfuscatedProfileId, other.obfuscatedProfileId) && + MessagesPigeonUtils.deepEquals(this.oldProduct, other.oldProduct) && + MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) } override fun hashCode(): Int { @@ -812,15 +857,14 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformPricingPhase ( - val billingCycleCount: Long, - val recurrenceMode: PlatformRecurrenceMode, - val priceAmountMicros: Long, - val billingPeriod: String, - val formattedPrice: String, - val priceCurrencyCode: String -) - { +data class PlatformPricingPhase( + val billingCycleCount: Long, + val recurrenceMode: PlatformRecurrenceMode, + val priceAmountMicros: Long, + val billingPeriod: String, + val formattedPrice: String, + val priceCurrencyCode: String +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformPricingPhase { val billingCycleCount = pigeonVar_list[0] as Long @@ -829,19 +873,27 @@ val billingPeriod = pigeonVar_list[3] as String val formattedPrice = pigeonVar_list[4] as String val priceCurrencyCode = pigeonVar_list[5] as String - return PlatformPricingPhase(billingCycleCount, recurrenceMode, priceAmountMicros, billingPeriod, formattedPrice, priceCurrencyCode) + return PlatformPricingPhase( + billingCycleCount, + recurrenceMode, + priceAmountMicros, + billingPeriod, + formattedPrice, + priceCurrencyCode) } } + fun toList(): List<Any?> { return listOf( - billingCycleCount, - recurrenceMode, - priceAmountMicros, - billingPeriod, - formattedPrice, - priceCurrencyCode, + billingCycleCount, + recurrenceMode, + priceAmountMicros, + billingPeriod, + formattedPrice, + priceCurrencyCode, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -850,7 +902,12 @@ return true } val other = other as PlatformPricingPhase - return MessagesPigeonUtils.deepEquals(this.billingCycleCount, other.billingCycleCount) && MessagesPigeonUtils.deepEquals(this.recurrenceMode, other.recurrenceMode) && MessagesPigeonUtils.deepEquals(this.priceAmountMicros, other.priceAmountMicros) && MessagesPigeonUtils.deepEquals(this.billingPeriod, other.billingPeriod) && MessagesPigeonUtils.deepEquals(this.formattedPrice, other.formattedPrice) && MessagesPigeonUtils.deepEquals(this.priceCurrencyCode, other.priceCurrencyCode) + return MessagesPigeonUtils.deepEquals(this.billingCycleCount, other.billingCycleCount) && + MessagesPigeonUtils.deepEquals(this.recurrenceMode, other.recurrenceMode) && + MessagesPigeonUtils.deepEquals(this.priceAmountMicros, other.priceAmountMicros) && + MessagesPigeonUtils.deepEquals(this.billingPeriod, other.billingPeriod) && + MessagesPigeonUtils.deepEquals(this.formattedPrice, other.formattedPrice) && + MessagesPigeonUtils.deepEquals(this.priceCurrencyCode, other.priceCurrencyCode) } override fun hashCode(): Int { @@ -872,23 +929,22 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformPurchase ( - val orderId: String? = null, - val packageName: String, - val purchaseTime: Long, - val purchaseToken: String, - val signature: String, - val products: List<String>, - val isAutoRenewing: Boolean, - val originalJson: String, - val developerPayload: String, - val isAcknowledged: Boolean, - val quantity: Long, - val purchaseState: PlatformPurchaseState, - val accountIdentifiers: PlatformAccountIdentifiers? = null, - val pendingPurchaseUpdate: PlatformPendingPurchaseUpdate? = null -) - { +data class PlatformPurchase( + val orderId: String? = null, + val packageName: String, + val purchaseTime: Long, + val purchaseToken: String, + val signature: String, + val products: List<String>, + val isAutoRenewing: Boolean, + val originalJson: String, + val developerPayload: String, + val isAcknowledged: Boolean, + val quantity: Long, + val purchaseState: PlatformPurchaseState, + val accountIdentifiers: PlatformAccountIdentifiers? = null, + val pendingPurchaseUpdate: PlatformPendingPurchaseUpdate? = null +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformPurchase { val orderId = pigeonVar_list[0] as String? @@ -905,27 +961,43 @@ val purchaseState = pigeonVar_list[11] as PlatformPurchaseState val accountIdentifiers = pigeonVar_list[12] as PlatformAccountIdentifiers? val pendingPurchaseUpdate = pigeonVar_list[13] as PlatformPendingPurchaseUpdate? - return PlatformPurchase(orderId, packageName, purchaseTime, purchaseToken, signature, products, isAutoRenewing, originalJson, developerPayload, isAcknowledged, quantity, purchaseState, accountIdentifiers, pendingPurchaseUpdate) + return PlatformPurchase( + orderId, + packageName, + purchaseTime, + purchaseToken, + signature, + products, + isAutoRenewing, + originalJson, + developerPayload, + isAcknowledged, + quantity, + purchaseState, + accountIdentifiers, + pendingPurchaseUpdate) } } + fun toList(): List<Any?> { return listOf( - orderId, - packageName, - purchaseTime, - purchaseToken, - signature, - products, - isAutoRenewing, - originalJson, - developerPayload, - isAcknowledged, - quantity, - purchaseState, - accountIdentifiers, - pendingPurchaseUpdate, + orderId, + packageName, + purchaseTime, + purchaseToken, + signature, + products, + isAutoRenewing, + originalJson, + developerPayload, + isAcknowledged, + quantity, + purchaseState, + accountIdentifiers, + pendingPurchaseUpdate, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -934,7 +1006,20 @@ return true } val other = other as PlatformPurchase - return MessagesPigeonUtils.deepEquals(this.orderId, other.orderId) && MessagesPigeonUtils.deepEquals(this.packageName, other.packageName) && MessagesPigeonUtils.deepEquals(this.purchaseTime, other.purchaseTime) && MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) && MessagesPigeonUtils.deepEquals(this.signature, other.signature) && MessagesPigeonUtils.deepEquals(this.products, other.products) && MessagesPigeonUtils.deepEquals(this.isAutoRenewing, other.isAutoRenewing) && MessagesPigeonUtils.deepEquals(this.originalJson, other.originalJson) && MessagesPigeonUtils.deepEquals(this.developerPayload, other.developerPayload) && MessagesPigeonUtils.deepEquals(this.isAcknowledged, other.isAcknowledged) && MessagesPigeonUtils.deepEquals(this.quantity, other.quantity) && MessagesPigeonUtils.deepEquals(this.purchaseState, other.purchaseState) && MessagesPigeonUtils.deepEquals(this.accountIdentifiers, other.accountIdentifiers) && MessagesPigeonUtils.deepEquals(this.pendingPurchaseUpdate, other.pendingPurchaseUpdate) + return MessagesPigeonUtils.deepEquals(this.orderId, other.orderId) && + MessagesPigeonUtils.deepEquals(this.packageName, other.packageName) && + MessagesPigeonUtils.deepEquals(this.purchaseTime, other.purchaseTime) && + MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) && + MessagesPigeonUtils.deepEquals(this.signature, other.signature) && + MessagesPigeonUtils.deepEquals(this.products, other.products) && + MessagesPigeonUtils.deepEquals(this.isAutoRenewing, other.isAutoRenewing) && + MessagesPigeonUtils.deepEquals(this.originalJson, other.originalJson) && + MessagesPigeonUtils.deepEquals(this.developerPayload, other.developerPayload) && + MessagesPigeonUtils.deepEquals(this.isAcknowledged, other.isAcknowledged) && + MessagesPigeonUtils.deepEquals(this.quantity, other.quantity) && + MessagesPigeonUtils.deepEquals(this.purchaseState, other.purchaseState) && + MessagesPigeonUtils.deepEquals(this.accountIdentifiers, other.accountIdentifiers) && + MessagesPigeonUtils.deepEquals(this.pendingPurchaseUpdate, other.pendingPurchaseUpdate) } override fun hashCode(): Int { @@ -964,11 +1049,7 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformPendingPurchaseUpdate ( - val products: List<String>, - val purchaseToken: String -) - { +data class PlatformPendingPurchaseUpdate(val products: List<String>, val purchaseToken: String) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformPendingPurchaseUpdate { val products = pigeonVar_list[0] as List<String> @@ -976,12 +1057,14 @@ return PlatformPendingPurchaseUpdate(products, purchaseToken) } } + fun toList(): List<Any?> { return listOf( - products, - purchaseToken, + products, + purchaseToken, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -990,7 +1073,8 @@ return true } val other = other as PlatformPendingPurchaseUpdate - return MessagesPigeonUtils.deepEquals(this.products, other.products) && MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) + return MessagesPigeonUtils.deepEquals(this.products, other.products) && + MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) } override fun hashCode(): Int { @@ -1008,16 +1092,15 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformPurchaseHistoryRecord ( - val quantity: Long, - val purchaseTime: Long, - val developerPayload: String? = null, - val originalJson: String, - val purchaseToken: String, - val signature: String, - val products: List<String> -) - { +data class PlatformPurchaseHistoryRecord( + val quantity: Long, + val purchaseTime: Long, + val developerPayload: String? = null, + val originalJson: String, + val purchaseToken: String, + val signature: String, + val products: List<String> +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformPurchaseHistoryRecord { val quantity = pigeonVar_list[0] as Long @@ -1027,20 +1110,29 @@ val purchaseToken = pigeonVar_list[4] as String val signature = pigeonVar_list[5] as String val products = pigeonVar_list[6] as List<String> - return PlatformPurchaseHistoryRecord(quantity, purchaseTime, developerPayload, originalJson, purchaseToken, signature, products) + return PlatformPurchaseHistoryRecord( + quantity, + purchaseTime, + developerPayload, + originalJson, + purchaseToken, + signature, + products) } } + fun toList(): List<Any?> { return listOf( - quantity, - purchaseTime, - developerPayload, - originalJson, - purchaseToken, - signature, - products, + quantity, + purchaseTime, + developerPayload, + originalJson, + purchaseToken, + signature, + products, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -1049,7 +1141,13 @@ return true } val other = other as PlatformPurchaseHistoryRecord - return MessagesPigeonUtils.deepEquals(this.quantity, other.quantity) && MessagesPigeonUtils.deepEquals(this.purchaseTime, other.purchaseTime) && MessagesPigeonUtils.deepEquals(this.developerPayload, other.developerPayload) && MessagesPigeonUtils.deepEquals(this.originalJson, other.originalJson) && MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) && MessagesPigeonUtils.deepEquals(this.signature, other.signature) && MessagesPigeonUtils.deepEquals(this.products, other.products) + return MessagesPigeonUtils.deepEquals(this.quantity, other.quantity) && + MessagesPigeonUtils.deepEquals(this.purchaseTime, other.purchaseTime) && + MessagesPigeonUtils.deepEquals(this.developerPayload, other.developerPayload) && + MessagesPigeonUtils.deepEquals(this.originalJson, other.originalJson) && + MessagesPigeonUtils.deepEquals(this.purchaseToken, other.purchaseToken) && + MessagesPigeonUtils.deepEquals(this.signature, other.signature) && + MessagesPigeonUtils.deepEquals(this.products, other.products) } override fun hashCode(): Int { @@ -1066,16 +1164,15 @@ } /** - * Pigeon version of PurchasesHistoryResult, which contains the components of - * the Java PurchaseHistoryResponseListener callback. + * Pigeon version of PurchasesHistoryResult, which contains the components of the Java + * PurchaseHistoryResponseListener callback. * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformPurchaseHistoryResponse ( - val billingResult: PlatformBillingResult, - val purchases: List<PlatformPurchaseHistoryRecord> -) - { +data class PlatformPurchaseHistoryResponse( + val billingResult: PlatformBillingResult, + val purchases: List<PlatformPurchaseHistoryRecord> +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformPurchaseHistoryResponse { val billingResult = pigeonVar_list[0] as PlatformBillingResult @@ -1083,12 +1180,14 @@ return PlatformPurchaseHistoryResponse(billingResult, purchases) } } + fun toList(): List<Any?> { return listOf( - billingResult, - purchases, + billingResult, + purchases, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -1097,7 +1196,8 @@ return true } val other = other as PlatformPurchaseHistoryResponse - return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && MessagesPigeonUtils.deepEquals(this.purchases, other.purchases) + return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && + MessagesPigeonUtils.deepEquals(this.purchases, other.purchases) } override fun hashCode(): Int { @@ -1109,16 +1209,15 @@ } /** - * Pigeon version of PurchasesResultWrapper, which contains the components of - * the Java PurchasesResponseListener callback. + * Pigeon version of PurchasesResultWrapper, which contains the components of the Java + * PurchasesResponseListener callback. * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformPurchasesResponse ( - val billingResult: PlatformBillingResult, - val purchases: List<PlatformPurchase> -) - { +data class PlatformPurchasesResponse( + val billingResult: PlatformBillingResult, + val purchases: List<PlatformPurchase> +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformPurchasesResponse { val billingResult = pigeonVar_list[0] as PlatformBillingResult @@ -1126,12 +1225,14 @@ return PlatformPurchasesResponse(billingResult, purchases) } } + fun toList(): List<Any?> { return listOf( - billingResult, - purchases, + billingResult, + purchases, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -1140,7 +1241,8 @@ return true } val other = other as PlatformPurchasesResponse - return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && MessagesPigeonUtils.deepEquals(this.purchases, other.purchases) + return MessagesPigeonUtils.deepEquals(this.billingResult, other.billingResult) && + MessagesPigeonUtils.deepEquals(this.purchases, other.purchases) } override fun hashCode(): Int { @@ -1156,15 +1258,14 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformSubscriptionOfferDetails ( - val basePlanId: String, - val offerId: String? = null, - val offerToken: String, - val offerTags: List<String>, - val pricingPhases: List<PlatformPricingPhase>, - val installmentPlanDetails: PlatformInstallmentPlanDetails? = null -) - { +data class PlatformSubscriptionOfferDetails( + val basePlanId: String, + val offerId: String? = null, + val offerToken: String, + val offerTags: List<String>, + val pricingPhases: List<PlatformPricingPhase>, + val installmentPlanDetails: PlatformInstallmentPlanDetails? = null +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformSubscriptionOfferDetails { val basePlanId = pigeonVar_list[0] as String @@ -1173,19 +1274,22 @@ val offerTags = pigeonVar_list[3] as List<String> val pricingPhases = pigeonVar_list[4] as List<PlatformPricingPhase> val installmentPlanDetails = pigeonVar_list[5] as PlatformInstallmentPlanDetails? - return PlatformSubscriptionOfferDetails(basePlanId, offerId, offerToken, offerTags, pricingPhases, installmentPlanDetails) + return PlatformSubscriptionOfferDetails( + basePlanId, offerId, offerToken, offerTags, pricingPhases, installmentPlanDetails) } } + fun toList(): List<Any?> { return listOf( - basePlanId, - offerId, - offerToken, - offerTags, - pricingPhases, - installmentPlanDetails, + basePlanId, + offerId, + offerToken, + offerTags, + pricingPhases, + installmentPlanDetails, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -1194,7 +1298,12 @@ return true } val other = other as PlatformSubscriptionOfferDetails - return MessagesPigeonUtils.deepEquals(this.basePlanId, other.basePlanId) && MessagesPigeonUtils.deepEquals(this.offerId, other.offerId) && MessagesPigeonUtils.deepEquals(this.offerToken, other.offerToken) && MessagesPigeonUtils.deepEquals(this.offerTags, other.offerTags) && MessagesPigeonUtils.deepEquals(this.pricingPhases, other.pricingPhases) && MessagesPigeonUtils.deepEquals(this.installmentPlanDetails, other.installmentPlanDetails) + return MessagesPigeonUtils.deepEquals(this.basePlanId, other.basePlanId) && + MessagesPigeonUtils.deepEquals(this.offerId, other.offerId) && + MessagesPigeonUtils.deepEquals(this.offerToken, other.offerToken) && + MessagesPigeonUtils.deepEquals(this.offerTags, other.offerTags) && + MessagesPigeonUtils.deepEquals(this.pricingPhases, other.pricingPhases) && + MessagesPigeonUtils.deepEquals(this.installmentPlanDetails, other.installmentPlanDetails) } override fun hashCode(): Int { @@ -1214,27 +1323,29 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformUserChoiceDetails ( - val originalExternalTransactionId: String? = null, - val externalTransactionToken: String, - val products: List<PlatformUserChoiceProduct> -) - { +data class PlatformUserChoiceDetails( + val originalExternalTransactionId: String? = null, + val externalTransactionToken: String, + val products: List<PlatformUserChoiceProduct> +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformUserChoiceDetails { val originalExternalTransactionId = pigeonVar_list[0] as String? val externalTransactionToken = pigeonVar_list[1] as String val products = pigeonVar_list[2] as List<PlatformUserChoiceProduct> - return PlatformUserChoiceDetails(originalExternalTransactionId, externalTransactionToken, products) + return PlatformUserChoiceDetails( + originalExternalTransactionId, externalTransactionToken, products) } } + fun toList(): List<Any?> { return listOf( - originalExternalTransactionId, - externalTransactionToken, - products, + originalExternalTransactionId, + externalTransactionToken, + products, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -1243,7 +1354,11 @@ return true } val other = other as PlatformUserChoiceDetails - return MessagesPigeonUtils.deepEquals(this.originalExternalTransactionId, other.originalExternalTransactionId) && MessagesPigeonUtils.deepEquals(this.externalTransactionToken, other.externalTransactionToken) && MessagesPigeonUtils.deepEquals(this.products, other.products) + return MessagesPigeonUtils.deepEquals( + this.originalExternalTransactionId, other.originalExternalTransactionId) && + MessagesPigeonUtils.deepEquals( + this.externalTransactionToken, other.externalTransactionToken) && + MessagesPigeonUtils.deepEquals(this.products, other.products) } override fun hashCode(): Int { @@ -1260,12 +1375,11 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformUserChoiceProduct ( - val id: String, - val offerToken: String? = null, - val type: PlatformProductType -) - { +data class PlatformUserChoiceProduct( + val id: String, + val offerToken: String? = null, + val type: PlatformProductType +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformUserChoiceProduct { val id = pigeonVar_list[0] as String @@ -1274,13 +1388,15 @@ return PlatformUserChoiceProduct(id, offerToken, type) } } + fun toList(): List<Any?> { return listOf( - id, - offerToken, - type, + id, + offerToken, + type, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -1289,7 +1405,9 @@ return true } val other = other as PlatformUserChoiceProduct - return MessagesPigeonUtils.deepEquals(this.id, other.id) && MessagesPigeonUtils.deepEquals(this.offerToken, other.offerToken) && MessagesPigeonUtils.deepEquals(this.type, other.type) + return MessagesPigeonUtils.deepEquals(this.id, other.id) && + MessagesPigeonUtils.deepEquals(this.offerToken, other.offerToken) && + MessagesPigeonUtils.deepEquals(this.type, other.type) } override fun hashCode(): Int { @@ -1307,24 +1425,26 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformInstallmentPlanDetails ( - val commitmentPaymentsCount: Long, - val subsequentCommitmentPaymentsCount: Long -) - { +data class PlatformInstallmentPlanDetails( + val commitmentPaymentsCount: Long, + val subsequentCommitmentPaymentsCount: Long +) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformInstallmentPlanDetails { val commitmentPaymentsCount = pigeonVar_list[0] as Long val subsequentCommitmentPaymentsCount = pigeonVar_list[1] as Long - return PlatformInstallmentPlanDetails(commitmentPaymentsCount, subsequentCommitmentPaymentsCount) + return PlatformInstallmentPlanDetails( + commitmentPaymentsCount, subsequentCommitmentPaymentsCount) } } + fun toList(): List<Any?> { return listOf( - commitmentPaymentsCount, - subsequentCommitmentPaymentsCount, + commitmentPaymentsCount, + subsequentCommitmentPaymentsCount, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -1333,7 +1453,10 @@ return true } val other = other as PlatformInstallmentPlanDetails - return MessagesPigeonUtils.deepEquals(this.commitmentPaymentsCount, other.commitmentPaymentsCount) && MessagesPigeonUtils.deepEquals(this.subsequentCommitmentPaymentsCount, other.subsequentCommitmentPaymentsCount) + return MessagesPigeonUtils.deepEquals( + this.commitmentPaymentsCount, other.commitmentPaymentsCount) && + MessagesPigeonUtils.deepEquals( + this.subsequentCommitmentPaymentsCount, other.subsequentCommitmentPaymentsCount) } override fun hashCode(): Int { @@ -1349,21 +1472,20 @@ * * Generated class from Pigeon that represents data sent in messages. */ -data class PlatformPendingPurchasesParams ( - val enablePrepaidPlans: Boolean -) - { +data class PlatformPendingPurchasesParams(val enablePrepaidPlans: Boolean) { companion object { fun fromList(pigeonVar_list: List<Any?>): PlatformPendingPurchasesParams { val enablePrepaidPlans = pigeonVar_list[0] as Boolean return PlatformPendingPurchasesParams(enablePrepaidPlans) } } + fun toList(): List<Any?> { return listOf( - enablePrepaidPlans, + enablePrepaidPlans, ) } + override fun equals(other: Any?): Boolean { if (other == null || other.javaClass != javaClass) { return false @@ -1381,63 +1503,42 @@ return result } } + private open class MessagesPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Long?)?.let { - PlatformBillingResponse.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { PlatformBillingResponse.ofRaw(it.toInt()) } } 130.toByte() -> { - return (readValue(buffer) as Long?)?.let { - PlatformInAppMessageResponse.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { PlatformInAppMessageResponse.ofRaw(it.toInt()) } } 131.toByte() -> { - return (readValue(buffer) as Long?)?.let { - PlatformReplacementMode.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { PlatformReplacementMode.ofRaw(it.toInt()) } } 132.toByte() -> { - return (readValue(buffer) as Long?)?.let { - PlatformProductType.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { PlatformProductType.ofRaw(it.toInt()) } } 133.toByte() -> { - return (readValue(buffer) as Long?)?.let { - PlatformBillingChoiceMode.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { PlatformBillingChoiceMode.ofRaw(it.toInt()) } } 134.toByte() -> { - return (readValue(buffer) as Long?)?.let { - PlatformBillingClientFeature.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { PlatformBillingClientFeature.ofRaw(it.toInt()) } } 135.toByte() -> { - return (readValue(buffer) as Long?)?.let { - PlatformPurchaseState.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { PlatformPurchaseState.ofRaw(it.toInt()) } } 136.toByte() -> { - return (readValue(buffer) as Long?)?.let { - PlatformRecurrenceMode.ofRaw(it.toInt()) - } + return (readValue(buffer) as Long?)?.let { PlatformRecurrenceMode.ofRaw(it.toInt()) } } 137.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformQueryProduct.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformQueryProduct.fromList(it) } } 138.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformAccountIdentifiers.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformAccountIdentifiers.fromList(it) } } 139.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformBillingResult.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformBillingResult.fromList(it) } } 140.toByte() -> { return (readValue(buffer) as? List<Any?>)?.let { @@ -1445,9 +1546,7 @@ } } 141.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformProductDetails.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformProductDetails.fromList(it) } } 142.toByte() -> { return (readValue(buffer) as? List<Any?>)?.let { @@ -1460,9 +1559,7 @@ } } 144.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformInAppMessageResult.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformInAppMessageResult.fromList(it) } } 145.toByte() -> { return (readValue(buffer) as? List<Any?>)?.let { @@ -1470,19 +1567,13 @@ } } 146.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformBillingFlowParams.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformBillingFlowParams.fromList(it) } } 147.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformPricingPhase.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformPricingPhase.fromList(it) } } 148.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformPurchase.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformPurchase.fromList(it) } } 149.toByte() -> { return (readValue(buffer) as? List<Any?>)?.let { @@ -1500,9 +1591,7 @@ } } 152.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformPurchasesResponse.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformPurchasesResponse.fromList(it) } } 153.toByte() -> { return (readValue(buffer) as? List<Any?>)?.let { @@ -1510,14 +1599,10 @@ } } 154.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformUserChoiceDetails.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformUserChoiceDetails.fromList(it) } } 155.toByte() -> { - return (readValue(buffer) as? List<Any?>)?.let { - PlatformUserChoiceProduct.fromList(it) - } + return (readValue(buffer) as? List<Any?>)?.let { PlatformUserChoiceProduct.fromList(it) } } 156.toByte() -> { return (readValue(buffer) as? List<Any?>)?.let { @@ -1532,7 +1617,8 @@ else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is PlatformBillingResponse -> { stream.write(129) @@ -1655,58 +1741,98 @@ } } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface InAppPurchaseApi { /** Wraps BillingClient#isReady. */ fun isReady(): Boolean /** Wraps BillingClient#startConnection(BillingClientStateListener). */ - fun startConnection(callbackHandle: Long, billingMode: PlatformBillingChoiceMode, pendingPurchasesParams: PlatformPendingPurchasesParams, callback: (Result<PlatformBillingResult>) -> Unit) + fun startConnection( + callbackHandle: Long, + billingMode: PlatformBillingChoiceMode, + pendingPurchasesParams: PlatformPendingPurchasesParams, + callback: (Result<PlatformBillingResult>) -> Unit + ) /** Wraps BillingClient#endConnection(BillingClientStateListener). */ fun endConnection() - /** Wraps BillingClient#getBillingConfigAsync(GetBillingConfigParams, BillingConfigResponseListener). */ + /** + * Wraps BillingClient#getBillingConfigAsync(GetBillingConfigParams, + * BillingConfigResponseListener). + */ fun getBillingConfigAsync(callback: (Result<PlatformBillingConfigResponse>) -> Unit) /** Wraps BillingClient#launchBillingFlow(Activity, BillingFlowParams). */ fun launchBillingFlow(params: PlatformBillingFlowParams): PlatformBillingResult - /** Wraps BillingClient#acknowledgePurchase(AcknowledgePurchaseParams, AcknowledgePurchaseResponseListener). */ + /** + * Wraps BillingClient#acknowledgePurchase(AcknowledgePurchaseParams, + * AcknowledgePurchaseResponseListener). + */ fun acknowledgePurchase(purchaseToken: String, callback: (Result<PlatformBillingResult>) -> Unit) /** Wraps BillingClient#consumeAsync(ConsumeParams, ConsumeResponseListener). */ fun consumeAsync(purchaseToken: String, callback: (Result<PlatformBillingResult>) -> Unit) /** Wraps BillingClient#queryPurchasesAsync(QueryPurchaseParams, PurchaseResponseListener). */ - fun queryPurchasesAsync(productType: PlatformProductType, callback: (Result<PlatformPurchasesResponse>) -> Unit) - /** Wraps BillingClient#queryPurchaseHistoryAsync(QueryPurchaseHistoryParams, PurchaseHistoryResponseListener). */ - fun queryPurchaseHistoryAsync(productType: PlatformProductType, callback: (Result<PlatformPurchaseHistoryResponse>) -> Unit) - /** Wraps BillingClient#queryProductDetailsAsync(QueryProductDetailsParams, ProductDetailsResponseListener). */ - fun queryProductDetailsAsync(products: List<PlatformQueryProduct>, callback: (Result<PlatformProductDetailsResponse>) -> Unit) + fun queryPurchasesAsync( + productType: PlatformProductType, + callback: (Result<PlatformPurchasesResponse>) -> Unit + ) + /** + * Wraps BillingClient#queryPurchaseHistoryAsync(QueryPurchaseHistoryParams, + * PurchaseHistoryResponseListener). + */ + fun queryPurchaseHistoryAsync( + productType: PlatformProductType, + callback: (Result<PlatformPurchaseHistoryResponse>) -> Unit + ) + /** + * Wraps BillingClient#queryProductDetailsAsync(QueryProductDetailsParams, + * ProductDetailsResponseListener). + */ + fun queryProductDetailsAsync( + products: List<PlatformQueryProduct>, + callback: (Result<PlatformProductDetailsResponse>) -> Unit + ) /** Wraps BillingClient#isFeatureSupported(String). */ fun isFeatureSupported(feature: PlatformBillingClientFeature): Boolean /** Wraps BillingClient#isAlternativeBillingOnlyAvailableAsync(). */ fun isAlternativeBillingOnlyAvailableAsync(callback: (Result<PlatformBillingResult>) -> Unit) /** Wraps BillingClient#showAlternativeBillingOnlyInformationDialog(). */ fun showAlternativeBillingOnlyInformationDialog(callback: (Result<PlatformBillingResult>) -> Unit) - /** Wraps BillingClient#createAlternativeBillingOnlyReportingDetailsAsync(AlternativeBillingOnlyReportingDetailsListener). */ - fun createAlternativeBillingOnlyReportingDetailsAsync(callback: (Result<PlatformAlternativeBillingOnlyReportingDetailsResponse>) -> Unit) + /** + * Wraps + * BillingClient#createAlternativeBillingOnlyReportingDetailsAsync(AlternativeBillingOnlyReportingDetailsListener). + */ + fun createAlternativeBillingOnlyReportingDetailsAsync( + callback: (Result<PlatformAlternativeBillingOnlyReportingDetailsResponse>) -> Unit + ) /** Wraps BillingClient#showInAppMessages(). */ fun showInAppMessages(callback: (Result<PlatformInAppMessageResult>) -> Unit) companion object { /** The codec used by InAppPurchaseApi. */ - val codec: MessageCodec<Any?> by lazy { - MessagesPigeonCodec() - } - /** Sets up an instance of `InAppPurchaseApi` to handle messages through the `binaryMessenger`. */ + val codec: MessageCodec<Any?> by lazy { MessagesPigeonCodec() } + /** + * Sets up an instance of `InAppPurchaseApi` to handle messages through the `binaryMessenger`. + */ @JvmOverloads - fun setUp(binaryMessenger: BinaryMessenger, api: InAppPurchaseApi?, messageChannelSuffix: String = "") { - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + fun setUp( + binaryMessenger: BinaryMessenger, + api: InAppPurchaseApi?, + messageChannelSuffix: String = "" + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isReady$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isReady$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List<Any?> = try { - listOf(api.isReady()) - } catch (exception: Throwable) { - MessagesPigeonUtils.wrapError(exception) - } + val wrapped: List<Any?> = + try { + listOf(api.isReady()) + } catch (exception: Throwable) { + MessagesPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1714,14 +1840,19 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.startConnection$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.startConnection$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List<Any?> val callbackHandleArg = args[0] as Long val billingModeArg = args[1] as PlatformBillingChoiceMode val pendingPurchasesParamsArg = args[2] as PlatformPendingPurchasesParams - api.startConnection(callbackHandleArg, billingModeArg, pendingPurchasesParamsArg) { result: Result<PlatformBillingResult> -> + api.startConnection(callbackHandleArg, billingModeArg, pendingPurchasesParamsArg) { + result: Result<PlatformBillingResult> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(MessagesPigeonUtils.wrapError(error)) @@ -1736,15 +1867,20 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.endConnection$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.endConnection$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List<Any?> = try { - api.endConnection() - listOf(null) - } catch (exception: Throwable) { - MessagesPigeonUtils.wrapError(exception) - } + val wrapped: List<Any?> = + try { + api.endConnection() + listOf(null) + } catch (exception: Throwable) { + MessagesPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1752,10 +1888,14 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.getBillingConfigAsync$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.getBillingConfigAsync$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.getBillingConfigAsync{ result: Result<PlatformBillingConfigResponse> -> + api.getBillingConfigAsync { result: Result<PlatformBillingConfigResponse> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(MessagesPigeonUtils.wrapError(error)) @@ -1770,16 +1910,21 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.launchBillingFlow$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.launchBillingFlow$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List<Any?> val paramsArg = args[0] as PlatformBillingFlowParams - val wrapped: List<Any?> = try { - listOf(api.launchBillingFlow(paramsArg)) - } catch (exception: Throwable) { - MessagesPigeonUtils.wrapError(exception) - } + val wrapped: List<Any?> = + try { + listOf(api.launchBillingFlow(paramsArg)) + } catch (exception: Throwable) { + MessagesPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1787,7 +1932,11 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.acknowledgePurchase$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.acknowledgePurchase$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List<Any?> @@ -1807,7 +1956,11 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.consumeAsync$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.consumeAsync$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List<Any?> @@ -1827,7 +1980,11 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchasesAsync$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchasesAsync$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List<Any?> @@ -1847,12 +2004,17 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchaseHistoryAsync$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchaseHistoryAsync$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List<Any?> val productTypeArg = args[0] as PlatformProductType - api.queryPurchaseHistoryAsync(productTypeArg) { result: Result<PlatformPurchaseHistoryResponse> -> + api.queryPurchaseHistoryAsync(productTypeArg) { + result: Result<PlatformPurchaseHistoryResponse> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(MessagesPigeonUtils.wrapError(error)) @@ -1867,12 +2029,17 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryProductDetailsAsync$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryProductDetailsAsync$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List<Any?> val productsArg = args[0] as List<PlatformQueryProduct> - api.queryProductDetailsAsync(productsArg) { result: Result<PlatformProductDetailsResponse> -> + api.queryProductDetailsAsync(productsArg) { + result: Result<PlatformProductDetailsResponse> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(MessagesPigeonUtils.wrapError(error)) @@ -1887,16 +2054,21 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isFeatureSupported$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isFeatureSupported$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List<Any?> val featureArg = args[0] as PlatformBillingClientFeature - val wrapped: List<Any?> = try { - listOf(api.isFeatureSupported(featureArg)) - } catch (exception: Throwable) { - MessagesPigeonUtils.wrapError(exception) - } + val wrapped: List<Any?> = + try { + listOf(api.isFeatureSupported(featureArg)) + } catch (exception: Throwable) { + MessagesPigeonUtils.wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1904,10 +2076,14 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isAlternativeBillingOnlyAvailableAsync$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isAlternativeBillingOnlyAvailableAsync$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.isAlternativeBillingOnlyAvailableAsync{ result: Result<PlatformBillingResult> -> + api.isAlternativeBillingOnlyAvailableAsync { result: Result<PlatformBillingResult> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(MessagesPigeonUtils.wrapError(error)) @@ -1922,10 +2098,15 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showAlternativeBillingOnlyInformationDialog$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showAlternativeBillingOnlyInformationDialog$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.showAlternativeBillingOnlyInformationDialog{ result: Result<PlatformBillingResult> -> + api.showAlternativeBillingOnlyInformationDialog { result: Result<PlatformBillingResult> + -> val error = result.exceptionOrNull() if (error != null) { reply.reply(MessagesPigeonUtils.wrapError(error)) @@ -1940,10 +2121,15 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.createAlternativeBillingOnlyReportingDetailsAsync$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.createAlternativeBillingOnlyReportingDetailsAsync$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.createAlternativeBillingOnlyReportingDetailsAsync{ result: Result<PlatformAlternativeBillingOnlyReportingDetailsResponse> -> + api.createAlternativeBillingOnlyReportingDetailsAsync { + result: Result<PlatformAlternativeBillingOnlyReportingDetailsResponse> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(MessagesPigeonUtils.wrapError(error)) @@ -1958,10 +2144,14 @@ } } run { - val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showInAppMessages$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel<Any?>( + binaryMessenger, + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showInAppMessages$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.showInAppMessages{ result: Result<PlatformInAppMessageResult> -> + api.showInAppMessages { result: Result<PlatformInAppMessageResult> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(MessagesPigeonUtils.wrapError(error)) @@ -1979,18 +2169,20 @@ } } /** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -class InAppPurchaseCallbackApi(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { +class InAppPurchaseCallbackApi( + private val binaryMessenger: BinaryMessenger, + private val messageChannelSuffix: String = "" +) { companion object { /** The codec used by InAppPurchaseCallbackApi. */ - val codec: MessageCodec<Any?> by lazy { - MessagesPigeonCodec() - } + val codec: MessageCodec<Any?> by lazy { MessagesPigeonCodec() } } /** Called for `BillingClientStateListener#onBillingServiceDisconnected()`. */ - fun onBillingServiceDisconnected(callbackHandleArg: Long, callback: (Result<Unit>) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected$separatedMessageChannelSuffix" + fun onBillingServiceDisconnected(callbackHandleArg: Long, callback: (Result<Unit>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected$separatedMessageChannelSuffix" val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec) channel.send(listOf(callbackHandleArg)) { if (it is List<*>) { @@ -2001,14 +2193,15 @@ } } else { callback(Result.failure(MessagesPigeonUtils.createConnectionError(channelName))) - } + } } } /** Called for `PurchasesUpdatedListener#onPurchasesUpdated(BillingResult, List<Purchase>)`. */ - fun onPurchasesUpdated(updateArg: PlatformPurchasesResponse, callback: (Result<Unit>) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated$separatedMessageChannelSuffix" + fun onPurchasesUpdated(updateArg: PlatformPurchasesResponse, callback: (Result<Unit>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated$separatedMessageChannelSuffix" val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec) channel.send(listOf(updateArg)) { if (it is List<*>) { @@ -2019,14 +2212,18 @@ } } else { callback(Result.failure(MessagesPigeonUtils.createConnectionError(channelName))) - } + } } } /** Called for `UserChoiceBillingListener#userSelectedAlternativeBilling(UserChoiceDetails)`. */ - fun userSelectedalternativeBilling(detailsArg: PlatformUserChoiceDetails, callback: (Result<Unit>) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling$separatedMessageChannelSuffix" + fun userSelectedalternativeBilling( + detailsArg: PlatformUserChoiceDetails, + callback: (Result<Unit>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling$separatedMessageChannelSuffix" val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec) channel.send(listOf(detailsArg)) { if (it is List<*>) { @@ -2037,7 +2234,7 @@ } } else { callback(Result.failure(MessagesPigeonUtils.createConnectionError(channelName))) - } + } } } }
diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/kotlin/io/flutter/plugins/inapppurchase/Translator.kt b/packages/in_app_purchase/in_app_purchase_android/android/src/main/kotlin/io/flutter/plugins/inapppurchase/Translator.kt index 47f3df3..c5832ce 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/kotlin/io/flutter/plugins/inapppurchase/Translator.kt +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/kotlin/io/flutter/plugins/inapppurchase/Translator.kt
@@ -213,8 +213,9 @@ } fun fromInAppMessageResult(inAppMessageResult: InAppMessageResult): PlatformInAppMessageResult { - return PlatformInAppMessageResult( - fromInAppMessageResponseCode(inAppMessageResult.responseCode), inAppMessageResult.purchaseToken) + return PlatformInAppMessageResult( + fromInAppMessageResponseCode(inAppMessageResult.responseCode), + inAppMessageResult.purchaseToken) } fun fromBillingResponseCode(billingResponseCode: Int): PlatformBillingResponse = @@ -242,11 +243,13 @@ fun fromInAppMessageResponseCode( @InAppMessageResult.InAppMessageResponseCode inAppMessageResponseCode: Int ): PlatformInAppMessageResponse { - when (inAppMessageResponseCode) { - InAppMessageResult.InAppMessageResponseCode.SUBSCRIPTION_STATUS_UPDATED -> return PlatformInAppMessageResponse.SUBSCRIPTION_STATUS_UPDATED - InAppMessageResult.InAppMessageResponseCode.NO_ACTION_NEEDED -> return PlatformInAppMessageResponse.NO_ACTION_NEEDED - } - return PlatformInAppMessageResponse.NO_ACTION_NEEDED + when (inAppMessageResponseCode) { + InAppMessageResult.InAppMessageResponseCode.SUBSCRIPTION_STATUS_UPDATED -> + return PlatformInAppMessageResponse.SUBSCRIPTION_STATUS_UPDATED + InAppMessageResult.InAppMessageResponseCode.NO_ACTION_NEEDED -> + return PlatformInAppMessageResponse.NO_ACTION_NEEDED + } + return PlatformInAppMessageResponse.NO_ACTION_NEEDED } fun fromUserChoiceDetails(userChoiceDetails: UserChoiceDetails): PlatformUserChoiceDetails { @@ -272,7 +275,7 @@ result: BillingResult, billingConfig: BillingConfig? ): PlatformBillingConfigResponse { - return PlatformBillingConfigResponse(fromBillingResult(result), billingConfig?.countryCode ?: "") + return PlatformBillingConfigResponse(fromBillingResult(result), billingConfig?.countryCode ?: "") } /** Converter from [BillingResult] and [AlternativeBillingOnlyReportingDetails] to map. */
diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java index 9e532ca..6861ff3 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java
@@ -518,7 +518,9 @@ assertEquals( platformInAppMessageResult.result.getOrNull().getResponseCode(), fromInAppMessageResponseCode(inAppMessageResult.getResponseCode())); - assertEquals(platformInAppMessageResult.result.getOrNull().getPurchaseToken(), inAppMessageResult.getPurchaseToken()); + assertEquals( + platformInAppMessageResult.result.getOrNull().getPurchaseToken(), + inAppMessageResult.getPurchaseToken()); } @Test @@ -530,8 +532,7 @@ assertTrue(error instanceof FlutterError); FlutterError flutterError = (FlutterError) error; assertEquals("UNAVAILABLE", flutterError.getCode()); - assertTrue( - Objects.requireNonNull(flutterError.getMessage()).contains("BillingClient")); + assertTrue(Objects.requireNonNull(flutterError.getMessage()).contains("BillingClient")); } @Test @@ -544,8 +545,7 @@ assertTrue(exception instanceof FlutterError); assertEquals("ACTIVITY_UNAVAILABLE", ((FlutterError) exception).getCode()); assertTrue( - Objects.requireNonNull(exception.getMessage()) - .contains("Not attempting to show dialog")); + Objects.requireNonNull(exception.getMessage()).contains("Not attempting to show dialog")); } @Test
diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/messages.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/messages.g.dart index 19c1636..c2c7b8f 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/messages.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/messages.g.dart
@@ -13,9 +13,9 @@ import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; Object? _extractReplyValueOrThrow( - List<Object?>? replyList, - String channelName, { - required bool isNullValid, + List<Object?>? replyList, + String channelName, { + required bool isNullValid, }) { if (replyList == null) { throw PlatformException( @@ -37,8 +37,11 @@ return replyList.firstOrNull; } - -List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List<Object?> wrapResponse({ + Object? result, + PlatformException? error, + bool empty = false, +}) { if (empty) { return <Object?>[]; } @@ -47,6 +50,7 @@ } return <Object?>[error.code, error.message, error.details]; } + bool _deepEquals(Object? a, Object? b) { if (identical(a, b)) { return true; @@ -59,8 +63,9 @@ } if (a is List && b is List) { return a.length == b.length && - a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + a.indexed.every( + ((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]), + ); } if (a is Map && b is Map) { if (a.length != b.length) { @@ -109,7 +114,6 @@ return value.hashCode; } - /// Pigeon version of Java BillingClient.BillingResponseCode. enum PlatformBillingResponse { serviceTimeout, @@ -134,6 +138,7 @@ /// Note: The API callback won't indicate whether message is dismissed by the /// user or there is no message available to the user. noActionNeeded, + /// The subscription status changed. /// /// For example, a subscription has been recovered from a suspended state. @@ -152,10 +157,7 @@ } /// Pigeon version of Java BillingClient.ProductType. -enum PlatformProductType { - inapp, - subs, -} +enum PlatformProductType { inapp, subs } /// Pigeon version of billing_client_wrapper.dart's BillingChoiceMode. enum PlatformBillingChoiceMode { @@ -163,8 +165,10 @@ /// /// Default state. playBillingOnly, + /// Billing through app provided flow. alternativeBillingOnly, + /// Users can choose Play billing or alternative billing. userChoiceBilling, } @@ -182,39 +186,26 @@ } /// Pigeon version of Java Purchase.PurchaseState. -enum PlatformPurchaseState { - unspecified, - purchased, - pending, -} +enum PlatformPurchaseState { unspecified, purchased, pending } /// Pigeon version of Java ProductDetails.RecurrenceMode. -enum PlatformRecurrenceMode { - finiteRecurring, - infiniteRecurring, - nonRecurring, -} +enum PlatformRecurrenceMode { finiteRecurring, infiniteRecurring, nonRecurring } /// Pigeon version of Java QueryProductDetailsParams.Product. class PlatformQueryProduct { - PlatformQueryProduct({ - required this.productId, - required this.productType, - }); + PlatformQueryProduct({required this.productId, required this.productType}); String productId; PlatformProductType productType; List<Object?> _toList() { - return <Object?>[ - productId, - productType, - ]; + return <Object?>[productId, productType]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformQueryProduct decode(Object result) { result as List<Object?>; @@ -233,7 +224,8 @@ if (identical(this, other)) { return true; } - return _deepEquals(productId, other.productId) && _deepEquals(productType, other.productType); + return _deepEquals(productId, other.productId) && + _deepEquals(productType, other.productType); } @override @@ -253,14 +245,12 @@ String? obfuscatedProfileId; List<Object?> _toList() { - return <Object?>[ - obfuscatedAccountId, - obfuscatedProfileId, - ]; + return <Object?>[obfuscatedAccountId, obfuscatedProfileId]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformAccountIdentifiers decode(Object result) { result as List<Object?>; @@ -273,13 +263,15 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformAccountIdentifiers || other.runtimeType != runtimeType) { + if (other is! PlatformAccountIdentifiers || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(obfuscatedAccountId, other.obfuscatedAccountId) && _deepEquals(obfuscatedProfileId, other.obfuscatedProfileId); + return _deepEquals(obfuscatedAccountId, other.obfuscatedAccountId) && + _deepEquals(obfuscatedProfileId, other.obfuscatedProfileId); } @override @@ -299,14 +291,12 @@ String debugMessage; List<Object?> _toList() { - return <Object?>[ - responseCode, - debugMessage, - ]; + return <Object?>[responseCode, debugMessage]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformBillingResult decode(Object result) { result as List<Object?>; @@ -325,7 +315,8 @@ if (identical(this, other)) { return true; } - return _deepEquals(responseCode, other.responseCode) && _deepEquals(debugMessage, other.debugMessage); + return _deepEquals(responseCode, other.responseCode) && + _deepEquals(debugMessage, other.debugMessage); } @override @@ -348,15 +339,12 @@ String priceCurrencyCode; List<Object?> _toList() { - return <Object?>[ - priceAmountMicros, - formattedPrice, - priceCurrencyCode, - ]; + return <Object?>[priceAmountMicros, formattedPrice, priceCurrencyCode]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformOneTimePurchaseOfferDetails decode(Object result) { result as List<Object?>; @@ -370,13 +358,16 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformOneTimePurchaseOfferDetails || other.runtimeType != runtimeType) { + if (other is! PlatformOneTimePurchaseOfferDetails || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(priceAmountMicros, other.priceAmountMicros) && _deepEquals(formattedPrice, other.formattedPrice) && _deepEquals(priceCurrencyCode, other.priceCurrencyCode); + return _deepEquals(priceAmountMicros, other.priceAmountMicros) && + _deepEquals(formattedPrice, other.formattedPrice) && + _deepEquals(priceCurrencyCode, other.priceCurrencyCode); } @override @@ -423,7 +414,8 @@ } Object encode() { - return _toList(); } + return _toList(); + } static PlatformProductDetails decode(Object result) { result as List<Object?>; @@ -433,8 +425,10 @@ productId: result[2]! as String, productType: result[3]! as PlatformProductType, title: result[4]! as String, - oneTimePurchaseOfferDetails: result[5] as PlatformOneTimePurchaseOfferDetails?, - subscriptionOfferDetails: (result[6] as List<Object?>?)?.cast<PlatformSubscriptionOfferDetails>(), + oneTimePurchaseOfferDetails: + result[5] as PlatformOneTimePurchaseOfferDetails?, + subscriptionOfferDetails: (result[6] as List<Object?>?) + ?.cast<PlatformSubscriptionOfferDetails>(), ); } @@ -447,7 +441,16 @@ if (identical(this, other)) { return true; } - return _deepEquals(description, other.description) && _deepEquals(name, other.name) && _deepEquals(productId, other.productId) && _deepEquals(productType, other.productType) && _deepEquals(title, other.title) && _deepEquals(oneTimePurchaseOfferDetails, other.oneTimePurchaseOfferDetails) && _deepEquals(subscriptionOfferDetails, other.subscriptionOfferDetails); + return _deepEquals(description, other.description) && + _deepEquals(name, other.name) && + _deepEquals(productId, other.productId) && + _deepEquals(productType, other.productType) && + _deepEquals(title, other.title) && + _deepEquals( + oneTimePurchaseOfferDetails, + other.oneTimePurchaseOfferDetails, + ) && + _deepEquals(subscriptionOfferDetails, other.subscriptionOfferDetails); } @override @@ -468,33 +471,34 @@ List<PlatformProductDetails> productDetails; List<Object?> _toList() { - return <Object?>[ - billingResult, - productDetails, - ]; + return <Object?>[billingResult, productDetails]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformProductDetailsResponse decode(Object result) { result as List<Object?>; return PlatformProductDetailsResponse( billingResult: result[0]! as PlatformBillingResult, - productDetails: (result[1]! as List<Object?>).cast<PlatformProductDetails>(), + productDetails: (result[1]! as List<Object?>) + .cast<PlatformProductDetails>(), ); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformProductDetailsResponse || other.runtimeType != runtimeType) { + if (other is! PlatformProductDetailsResponse || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(billingResult, other.billingResult) && _deepEquals(productDetails, other.productDetails); + return _deepEquals(billingResult, other.billingResult) && + _deepEquals(productDetails, other.productDetails); } @override @@ -516,16 +520,16 @@ String externalTransactionToken; List<Object?> _toList() { - return <Object?>[ - billingResult, - externalTransactionToken, - ]; + return <Object?>[billingResult, externalTransactionToken]; } Object encode() { - return _toList(); } + return _toList(); + } - static PlatformAlternativeBillingOnlyReportingDetailsResponse decode(Object result) { + static PlatformAlternativeBillingOnlyReportingDetailsResponse decode( + Object result, + ) { result as List<Object?>; return PlatformAlternativeBillingOnlyReportingDetailsResponse( billingResult: result[0]! as PlatformBillingResult, @@ -536,13 +540,15 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformAlternativeBillingOnlyReportingDetailsResponse || other.runtimeType != runtimeType) { + if (other is! PlatformAlternativeBillingOnlyReportingDetailsResponse || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(billingResult, other.billingResult) && _deepEquals(externalTransactionToken, other.externalTransactionToken); + return _deepEquals(billingResult, other.billingResult) && + _deepEquals(externalTransactionToken, other.externalTransactionToken); } @override @@ -552,10 +558,7 @@ /// Results related to in-app messaging. class PlatformInAppMessageResult { - PlatformInAppMessageResult({ - required this.responseCode, - this.purchaseToken, - }); + PlatformInAppMessageResult({required this.responseCode, this.purchaseToken}); /// Returns response code for the in-app messaging API call. PlatformInAppMessageResponse responseCode; @@ -564,14 +567,12 @@ String? purchaseToken; List<Object?> _toList() { - return <Object?>[ - responseCode, - purchaseToken, - ]; + return <Object?>[responseCode, purchaseToken]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformInAppMessageResult decode(Object result) { result as List<Object?>; @@ -584,13 +585,15 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformInAppMessageResult || other.runtimeType != runtimeType) { + if (other is! PlatformInAppMessageResult || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(responseCode, other.responseCode) && _deepEquals(purchaseToken, other.purchaseToken); + return _deepEquals(responseCode, other.responseCode) && + _deepEquals(purchaseToken, other.purchaseToken); } @override @@ -611,14 +614,12 @@ String countryCode; List<Object?> _toList() { - return <Object?>[ - billingResult, - countryCode, - ]; + return <Object?>[billingResult, countryCode]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformBillingConfigResponse decode(Object result) { result as List<Object?>; @@ -631,13 +632,15 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformBillingConfigResponse || other.runtimeType != runtimeType) { + if (other is! PlatformBillingConfigResponse || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(billingResult, other.billingResult) && _deepEquals(countryCode, other.countryCode); + return _deepEquals(billingResult, other.billingResult) && + _deepEquals(countryCode, other.countryCode); } @override @@ -684,7 +687,8 @@ } Object encode() { - return _toList(); } + return _toList(); + } static PlatformBillingFlowParams decode(Object result) { result as List<Object?>; @@ -702,13 +706,20 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformBillingFlowParams || other.runtimeType != runtimeType) { + if (other is! PlatformBillingFlowParams || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(product, other.product) && _deepEquals(replacementMode, other.replacementMode) && _deepEquals(offerToken, other.offerToken) && _deepEquals(accountId, other.accountId) && _deepEquals(obfuscatedProfileId, other.obfuscatedProfileId) && _deepEquals(oldProduct, other.oldProduct) && _deepEquals(purchaseToken, other.purchaseToken); + return _deepEquals(product, other.product) && + _deepEquals(replacementMode, other.replacementMode) && + _deepEquals(offerToken, other.offerToken) && + _deepEquals(accountId, other.accountId) && + _deepEquals(obfuscatedProfileId, other.obfuscatedProfileId) && + _deepEquals(oldProduct, other.oldProduct) && + _deepEquals(purchaseToken, other.purchaseToken); } @override @@ -751,7 +762,8 @@ } Object encode() { - return _toList(); } + return _toList(); + } static PlatformPricingPhase decode(Object result) { result as List<Object?>; @@ -774,7 +786,12 @@ if (identical(this, other)) { return true; } - return _deepEquals(billingCycleCount, other.billingCycleCount) && _deepEquals(recurrenceMode, other.recurrenceMode) && _deepEquals(priceAmountMicros, other.priceAmountMicros) && _deepEquals(billingPeriod, other.billingPeriod) && _deepEquals(formattedPrice, other.formattedPrice) && _deepEquals(priceCurrencyCode, other.priceCurrencyCode); + return _deepEquals(billingCycleCount, other.billingCycleCount) && + _deepEquals(recurrenceMode, other.recurrenceMode) && + _deepEquals(priceAmountMicros, other.priceAmountMicros) && + _deepEquals(billingPeriod, other.billingPeriod) && + _deepEquals(formattedPrice, other.formattedPrice) && + _deepEquals(priceCurrencyCode, other.priceCurrencyCode); } @override @@ -851,7 +868,8 @@ } Object encode() { - return _toList(); } + return _toList(); + } static PlatformPurchase decode(Object result) { result as List<Object?>; @@ -882,7 +900,20 @@ if (identical(this, other)) { return true; } - return _deepEquals(orderId, other.orderId) && _deepEquals(packageName, other.packageName) && _deepEquals(purchaseTime, other.purchaseTime) && _deepEquals(purchaseToken, other.purchaseToken) && _deepEquals(signature, other.signature) && _deepEquals(products, other.products) && _deepEquals(isAutoRenewing, other.isAutoRenewing) && _deepEquals(originalJson, other.originalJson) && _deepEquals(developerPayload, other.developerPayload) && _deepEquals(isAcknowledged, other.isAcknowledged) && _deepEquals(quantity, other.quantity) && _deepEquals(purchaseState, other.purchaseState) && _deepEquals(accountIdentifiers, other.accountIdentifiers) && _deepEquals(pendingPurchaseUpdate, other.pendingPurchaseUpdate); + return _deepEquals(orderId, other.orderId) && + _deepEquals(packageName, other.packageName) && + _deepEquals(purchaseTime, other.purchaseTime) && + _deepEquals(purchaseToken, other.purchaseToken) && + _deepEquals(signature, other.signature) && + _deepEquals(products, other.products) && + _deepEquals(isAutoRenewing, other.isAutoRenewing) && + _deepEquals(originalJson, other.originalJson) && + _deepEquals(developerPayload, other.developerPayload) && + _deepEquals(isAcknowledged, other.isAcknowledged) && + _deepEquals(quantity, other.quantity) && + _deepEquals(purchaseState, other.purchaseState) && + _deepEquals(accountIdentifiers, other.accountIdentifiers) && + _deepEquals(pendingPurchaseUpdate, other.pendingPurchaseUpdate); } @override @@ -904,14 +935,12 @@ String purchaseToken; List<Object?> _toList() { - return <Object?>[ - products, - purchaseToken, - ]; + return <Object?>[products, purchaseToken]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformPendingPurchaseUpdate decode(Object result) { result as List<Object?>; @@ -924,13 +953,15 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformPendingPurchaseUpdate || other.runtimeType != runtimeType) { + if (other is! PlatformPendingPurchaseUpdate || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(products, other.products) && _deepEquals(purchaseToken, other.purchaseToken); + return _deepEquals(products, other.products) && + _deepEquals(purchaseToken, other.purchaseToken); } @override @@ -979,7 +1010,8 @@ } Object encode() { - return _toList(); } + return _toList(); + } static PlatformPurchaseHistoryRecord decode(Object result) { result as List<Object?>; @@ -997,13 +1029,20 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformPurchaseHistoryRecord || other.runtimeType != runtimeType) { + if (other is! PlatformPurchaseHistoryRecord || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(quantity, other.quantity) && _deepEquals(purchaseTime, other.purchaseTime) && _deepEquals(developerPayload, other.developerPayload) && _deepEquals(originalJson, other.originalJson) && _deepEquals(purchaseToken, other.purchaseToken) && _deepEquals(signature, other.signature) && _deepEquals(products, other.products); + return _deepEquals(quantity, other.quantity) && + _deepEquals(purchaseTime, other.purchaseTime) && + _deepEquals(developerPayload, other.developerPayload) && + _deepEquals(originalJson, other.originalJson) && + _deepEquals(purchaseToken, other.purchaseToken) && + _deepEquals(signature, other.signature) && + _deepEquals(products, other.products); } @override @@ -1024,33 +1063,34 @@ List<PlatformPurchaseHistoryRecord> purchases; List<Object?> _toList() { - return <Object?>[ - billingResult, - purchases, - ]; + return <Object?>[billingResult, purchases]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformPurchaseHistoryResponse decode(Object result) { result as List<Object?>; return PlatformPurchaseHistoryResponse( billingResult: result[0]! as PlatformBillingResult, - purchases: (result[1]! as List<Object?>).cast<PlatformPurchaseHistoryRecord>(), + purchases: (result[1]! as List<Object?>) + .cast<PlatformPurchaseHistoryRecord>(), ); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformPurchaseHistoryResponse || other.runtimeType != runtimeType) { + if (other is! PlatformPurchaseHistoryResponse || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(billingResult, other.billingResult) && _deepEquals(purchases, other.purchases); + return _deepEquals(billingResult, other.billingResult) && + _deepEquals(purchases, other.purchases); } @override @@ -1071,14 +1111,12 @@ List<PlatformPurchase> purchases; List<Object?> _toList() { - return <Object?>[ - billingResult, - purchases, - ]; + return <Object?>[billingResult, purchases]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformPurchasesResponse decode(Object result) { result as List<Object?>; @@ -1091,13 +1129,15 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformPurchasesResponse || other.runtimeType != runtimeType) { + if (other is! PlatformPurchasesResponse || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(billingResult, other.billingResult) && _deepEquals(purchases, other.purchases); + return _deepEquals(billingResult, other.billingResult) && + _deepEquals(purchases, other.purchases); } @override @@ -1140,7 +1180,8 @@ } Object encode() { - return _toList(); } + return _toList(); + } static PlatformSubscriptionOfferDetails decode(Object result) { result as List<Object?>; @@ -1157,13 +1198,19 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformSubscriptionOfferDetails || other.runtimeType != runtimeType) { + if (other is! PlatformSubscriptionOfferDetails || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(basePlanId, other.basePlanId) && _deepEquals(offerId, other.offerId) && _deepEquals(offerToken, other.offerToken) && _deepEquals(offerTags, other.offerTags) && _deepEquals(pricingPhases, other.pricingPhases) && _deepEquals(installmentPlanDetails, other.installmentPlanDetails); + return _deepEquals(basePlanId, other.basePlanId) && + _deepEquals(offerId, other.offerId) && + _deepEquals(offerToken, other.offerToken) && + _deepEquals(offerTags, other.offerTags) && + _deepEquals(pricingPhases, other.pricingPhases) && + _deepEquals(installmentPlanDetails, other.installmentPlanDetails); } @override @@ -1194,7 +1241,8 @@ } Object encode() { - return _toList(); } + return _toList(); + } static PlatformUserChoiceDetails decode(Object result) { result as List<Object?>; @@ -1208,13 +1256,19 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformUserChoiceDetails || other.runtimeType != runtimeType) { + if (other is! PlatformUserChoiceDetails || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(originalExternalTransactionId, other.originalExternalTransactionId) && _deepEquals(externalTransactionToken, other.externalTransactionToken) && _deepEquals(products, other.products); + return _deepEquals( + originalExternalTransactionId, + other.originalExternalTransactionId, + ) && + _deepEquals(externalTransactionToken, other.externalTransactionToken) && + _deepEquals(products, other.products); } @override @@ -1237,15 +1291,12 @@ PlatformProductType type; List<Object?> _toList() { - return <Object?>[ - id, - offerToken, - type, - ]; + return <Object?>[id, offerToken, type]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformUserChoiceProduct decode(Object result) { result as List<Object?>; @@ -1259,13 +1310,16 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformUserChoiceProduct || other.runtimeType != runtimeType) { + if (other is! PlatformUserChoiceProduct || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(id, other.id) && _deepEquals(offerToken, other.offerToken) && _deepEquals(type, other.type); + return _deepEquals(id, other.id) && + _deepEquals(offerToken, other.offerToken) && + _deepEquals(type, other.type); } @override @@ -1293,7 +1347,8 @@ } Object encode() { - return _toList(); } + return _toList(); + } static PlatformInstallmentPlanDetails decode(Object result) { result as List<Object?>; @@ -1306,13 +1361,21 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformInstallmentPlanDetails || other.runtimeType != runtimeType) { + if (other is! PlatformInstallmentPlanDetails || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { return true; } - return _deepEquals(commitmentPaymentsCount, other.commitmentPaymentsCount) && _deepEquals(subsequentCommitmentPaymentsCount, other.subsequentCommitmentPaymentsCount); + return _deepEquals( + commitmentPaymentsCount, + other.commitmentPaymentsCount, + ) && + _deepEquals( + subsequentCommitmentPaymentsCount, + other.subsequentCommitmentPaymentsCount, + ); } @override @@ -1322,20 +1385,17 @@ /// Pigeon version of Java PendingPurchasesParams. class PlatformPendingPurchasesParams { - PlatformPendingPurchasesParams({ - required this.enablePrepaidPlans, - }); + PlatformPendingPurchasesParams({required this.enablePrepaidPlans}); bool enablePrepaidPlans; List<Object?> _toList() { - return <Object?>[ - enablePrepaidPlans, - ]; + return <Object?>[enablePrepaidPlans]; } Object encode() { - return _toList(); } + return _toList(); + } static PlatformPendingPurchasesParams decode(Object result) { result as List<Object?>; @@ -1347,7 +1407,8 @@ @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - if (other is! PlatformPendingPurchasesParams || other.runtimeType != runtimeType) { + if (other is! PlatformPendingPurchasesParams || + other.runtimeType != runtimeType) { return false; } if (identical(this, other)) { @@ -1361,7 +1422,6 @@ int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]); } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -1369,91 +1429,92 @@ if (value is int) { buffer.putUint8(4); buffer.putInt64(value); - } else if (value is PlatformBillingResponse) { + } else if (value is PlatformBillingResponse) { buffer.putUint8(129); writeValue(buffer, value.index); - } else if (value is PlatformInAppMessageResponse) { + } else if (value is PlatformInAppMessageResponse) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is PlatformReplacementMode) { + } else if (value is PlatformReplacementMode) { buffer.putUint8(131); writeValue(buffer, value.index); - } else if (value is PlatformProductType) { + } else if (value is PlatformProductType) { buffer.putUint8(132); writeValue(buffer, value.index); - } else if (value is PlatformBillingChoiceMode) { + } else if (value is PlatformBillingChoiceMode) { buffer.putUint8(133); writeValue(buffer, value.index); - } else if (value is PlatformBillingClientFeature) { + } else if (value is PlatformBillingClientFeature) { buffer.putUint8(134); writeValue(buffer, value.index); - } else if (value is PlatformPurchaseState) { + } else if (value is PlatformPurchaseState) { buffer.putUint8(135); writeValue(buffer, value.index); - } else if (value is PlatformRecurrenceMode) { + } else if (value is PlatformRecurrenceMode) { buffer.putUint8(136); writeValue(buffer, value.index); - } else if (value is PlatformQueryProduct) { + } else if (value is PlatformQueryProduct) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformAccountIdentifiers) { + } else if (value is PlatformAccountIdentifiers) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformBillingResult) { + } else if (value is PlatformBillingResult) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformOneTimePurchaseOfferDetails) { + } else if (value is PlatformOneTimePurchaseOfferDetails) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformProductDetails) { + } else if (value is PlatformProductDetails) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformProductDetailsResponse) { + } else if (value is PlatformProductDetailsResponse) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformAlternativeBillingOnlyReportingDetailsResponse) { + } else if (value + is PlatformAlternativeBillingOnlyReportingDetailsResponse) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformInAppMessageResult) { + } else if (value is PlatformInAppMessageResult) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformBillingConfigResponse) { + } else if (value is PlatformBillingConfigResponse) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformBillingFlowParams) { + } else if (value is PlatformBillingFlowParams) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is PlatformPricingPhase) { + } else if (value is PlatformPricingPhase) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is PlatformPurchase) { + } else if (value is PlatformPurchase) { buffer.putUint8(148); writeValue(buffer, value.encode()); - } else if (value is PlatformPendingPurchaseUpdate) { + } else if (value is PlatformPendingPurchaseUpdate) { buffer.putUint8(149); writeValue(buffer, value.encode()); - } else if (value is PlatformPurchaseHistoryRecord) { + } else if (value is PlatformPurchaseHistoryRecord) { buffer.putUint8(150); writeValue(buffer, value.encode()); - } else if (value is PlatformPurchaseHistoryResponse) { + } else if (value is PlatformPurchaseHistoryResponse) { buffer.putUint8(151); writeValue(buffer, value.encode()); - } else if (value is PlatformPurchasesResponse) { + } else if (value is PlatformPurchasesResponse) { buffer.putUint8(152); writeValue(buffer, value.encode()); - } else if (value is PlatformSubscriptionOfferDetails) { + } else if (value is PlatformSubscriptionOfferDetails) { buffer.putUint8(153); writeValue(buffer, value.encode()); - } else if (value is PlatformUserChoiceDetails) { + } else if (value is PlatformUserChoiceDetails) { buffer.putUint8(154); writeValue(buffer, value.encode()); - } else if (value is PlatformUserChoiceProduct) { + } else if (value is PlatformUserChoiceProduct) { buffer.putUint8(155); writeValue(buffer, value.encode()); - } else if (value is PlatformInstallmentPlanDetails) { + } else if (value is PlatformInstallmentPlanDetails) { buffer.putUint8(156); writeValue(buffer, value.encode()); - } else if (value is PlatformPendingPurchasesParams) { + } else if (value is PlatformPendingPurchasesParams) { buffer.putUint8(157); writeValue(buffer, value.encode()); } else { @@ -1469,7 +1530,9 @@ return value == null ? null : PlatformBillingResponse.values[value]; case 130: final value = readValue(buffer) as int?; - return value == null ? null : PlatformInAppMessageResponse.values[value]; + return value == null + ? null + : PlatformInAppMessageResponse.values[value]; case 131: final value = readValue(buffer) as int?; return value == null ? null : PlatformReplacementMode.values[value]; @@ -1481,7 +1544,9 @@ return value == null ? null : PlatformBillingChoiceMode.values[value]; case 134: final value = readValue(buffer) as int?; - return value == null ? null : PlatformBillingClientFeature.values[value]; + return value == null + ? null + : PlatformBillingClientFeature.values[value]; case 135: final value = readValue(buffer) as int?; return value == null ? null : PlatformPurchaseState.values[value]; @@ -1501,7 +1566,9 @@ case 142: return PlatformProductDetailsResponse.decode(readValue(buffer)!); case 143: - return PlatformAlternativeBillingOnlyReportingDetailsResponse.decode(readValue(buffer)!); + return PlatformAlternativeBillingOnlyReportingDetailsResponse.decode( + readValue(buffer)!, + ); case 144: return PlatformInAppMessageResult.decode(readValue(buffer)!); case 145: @@ -1540,9 +1607,13 @@ /// Constructor for [InAppPurchaseApi]. 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. - InAppPurchaseApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + InAppPurchaseApi({ + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec(); @@ -1551,7 +1622,8 @@ /// Wraps BillingClient#isReady. Future<bool> isReady() async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isReady$pigeonVar_messageChannelSuffix'; + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isReady$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, @@ -1561,37 +1633,43 @@ final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as bool; } /// Wraps BillingClient#startConnection(BillingClientStateListener). - Future<PlatformBillingResult> startConnection(int callbackHandle, PlatformBillingChoiceMode billingMode, PlatformPendingPurchasesParams pendingPurchasesParams) async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.startConnection$pigeonVar_messageChannelSuffix'; + Future<PlatformBillingResult> startConnection( + int callbackHandle, + PlatformBillingChoiceMode billingMode, + PlatformPendingPurchasesParams pendingPurchasesParams, + ) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.startConnection$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[callbackHandle, billingMode, pendingPurchasesParams]); + final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send( + <Object?>[callbackHandle, billingMode, pendingPurchasesParams], + ); final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformBillingResult; } /// Wraps BillingClient#endConnection(BillingClientStateListener). Future<void> endConnection() async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.endConnection$pigeonVar_messageChannelSuffix'; + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.endConnection$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, @@ -1601,16 +1679,16 @@ final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: true, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ); } /// Wraps BillingClient#getBillingConfigAsync(GetBillingConfigParams, BillingConfigResponseListener). Future<PlatformBillingConfigResponse> getBillingConfigAsync() async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.getBillingConfigAsync$pigeonVar_messageChannelSuffix'; + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.getBillingConfigAsync$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, @@ -1620,157 +1698,181 @@ final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformBillingConfigResponse; } /// Wraps BillingClient#launchBillingFlow(Activity, BillingFlowParams). - Future<PlatformBillingResult> launchBillingFlow(PlatformBillingFlowParams params) async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.launchBillingFlow$pigeonVar_messageChannelSuffix'; + Future<PlatformBillingResult> launchBillingFlow( + PlatformBillingFlowParams params, + ) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.launchBillingFlow$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[params]); + final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send( + <Object?>[params], + ); final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformBillingResult; } /// Wraps BillingClient#acknowledgePurchase(AcknowledgePurchaseParams, AcknowledgePurchaseResponseListener). - Future<PlatformBillingResult> acknowledgePurchase(String purchaseToken) async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.acknowledgePurchase$pigeonVar_messageChannelSuffix'; + Future<PlatformBillingResult> acknowledgePurchase( + String purchaseToken, + ) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.acknowledgePurchase$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[purchaseToken]); + final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send( + <Object?>[purchaseToken], + ); final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformBillingResult; } /// Wraps BillingClient#consumeAsync(ConsumeParams, ConsumeResponseListener). Future<PlatformBillingResult> consumeAsync(String purchaseToken) async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.consumeAsync$pigeonVar_messageChannelSuffix'; + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.consumeAsync$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[purchaseToken]); + final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send( + <Object?>[purchaseToken], + ); final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformBillingResult; } /// Wraps BillingClient#queryPurchasesAsync(QueryPurchaseParams, PurchaseResponseListener). - Future<PlatformPurchasesResponse> queryPurchasesAsync(PlatformProductType productType) async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchasesAsync$pigeonVar_messageChannelSuffix'; + Future<PlatformPurchasesResponse> queryPurchasesAsync( + PlatformProductType productType, + ) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchasesAsync$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[productType]); + final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send( + <Object?>[productType], + ); final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformPurchasesResponse; } /// Wraps BillingClient#queryPurchaseHistoryAsync(QueryPurchaseHistoryParams, PurchaseHistoryResponseListener). - Future<PlatformPurchaseHistoryResponse> queryPurchaseHistoryAsync(PlatformProductType productType) async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchaseHistoryAsync$pigeonVar_messageChannelSuffix'; + Future<PlatformPurchaseHistoryResponse> queryPurchaseHistoryAsync( + PlatformProductType productType, + ) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchaseHistoryAsync$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[productType]); + final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send( + <Object?>[productType], + ); final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformPurchaseHistoryResponse; } /// Wraps BillingClient#queryProductDetailsAsync(QueryProductDetailsParams, ProductDetailsResponseListener). - Future<PlatformProductDetailsResponse> queryProductDetailsAsync(List<PlatformQueryProduct> products) async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryProductDetailsAsync$pigeonVar_messageChannelSuffix'; + Future<PlatformProductDetailsResponse> queryProductDetailsAsync( + List<PlatformQueryProduct> products, + ) async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryProductDetailsAsync$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[products]); + final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send( + <Object?>[products], + ); final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformProductDetailsResponse; } /// Wraps BillingClient#isFeatureSupported(String). Future<bool> isFeatureSupported(PlatformBillingClientFeature feature) async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isFeatureSupported$pigeonVar_messageChannelSuffix'; + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isFeatureSupported$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[feature]); + final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send( + <Object?>[feature], + ); final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as bool; } /// Wraps BillingClient#isAlternativeBillingOnlyAvailableAsync(). Future<PlatformBillingResult> isAlternativeBillingOnlyAvailableAsync() async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isAlternativeBillingOnlyAvailableAsync$pigeonVar_messageChannelSuffix'; + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isAlternativeBillingOnlyAvailableAsync$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, @@ -1780,17 +1882,18 @@ final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformBillingResult; } /// Wraps BillingClient#showAlternativeBillingOnlyInformationDialog(). - Future<PlatformBillingResult> showAlternativeBillingOnlyInformationDialog() async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showAlternativeBillingOnlyInformationDialog$pigeonVar_messageChannelSuffix'; + Future<PlatformBillingResult> + showAlternativeBillingOnlyInformationDialog() async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showAlternativeBillingOnlyInformationDialog$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, @@ -1800,17 +1903,18 @@ final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformBillingResult; } /// Wraps BillingClient#createAlternativeBillingOnlyReportingDetailsAsync(AlternativeBillingOnlyReportingDetailsListener). - Future<PlatformAlternativeBillingOnlyReportingDetailsResponse> createAlternativeBillingOnlyReportingDetailsAsync() async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.createAlternativeBillingOnlyReportingDetailsAsync$pigeonVar_messageChannelSuffix'; + Future<PlatformAlternativeBillingOnlyReportingDetailsResponse> + createAlternativeBillingOnlyReportingDetailsAsync() async { + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.createAlternativeBillingOnlyReportingDetailsAsync$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, @@ -1820,17 +1924,18 @@ final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; - return pigeonVar_replyValue! as PlatformAlternativeBillingOnlyReportingDetailsResponse; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! + as PlatformAlternativeBillingOnlyReportingDetailsResponse; } /// Wraps BillingClient#showInAppMessages(). Future<PlatformInAppMessageResult> showInAppMessages() async { - final pigeonVar_channelName = 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showInAppMessages$pigeonVar_messageChannelSuffix'; + final pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showInAppMessages$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel<Object?>( pigeonVar_channelName, pigeonChannelCodec, @@ -1840,11 +1945,10 @@ final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( - pigeonVar_replyList, - pigeonVar_channelName, - isNullValid: false, - ) - ; + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); return pigeonVar_replyValue! as PlatformInAppMessageResult; } } @@ -1861,12 +1965,20 @@ /// Called for `UserChoiceBillingListener#userSelectedAlternativeBilling(UserChoiceDetails)`. void userSelectedalternativeBilling(PlatformUserChoiceDetails details); - static void setUp(InAppPurchaseCallbackApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + InAppPurchaseCallbackApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; { final pigeonVar_channel = BasicMessageChannel<Object?>( - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected$messageChannelSuffix', pigeonChannelCodec, - binaryMessenger: binaryMessenger); + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger, + ); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { @@ -1878,50 +1990,62 @@ return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); } }); } } { final pigeonVar_channel = BasicMessageChannel<Object?>( - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated$messageChannelSuffix', pigeonChannelCodec, - binaryMessenger: binaryMessenger); + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger, + ); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { final List<Object?> args = message! as List<Object?>; - final PlatformPurchasesResponse arg_update = args[0]! as PlatformPurchasesResponse; + final PlatformPurchasesResponse arg_update = + args[0]! as PlatformPurchasesResponse; try { api.onPurchasesUpdated(arg_update); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); } }); } } { final pigeonVar_channel = BasicMessageChannel<Object?>( - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling$messageChannelSuffix', pigeonChannelCodec, - binaryMessenger: binaryMessenger); + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger, + ); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { final List<Object?> args = message! as List<Object?>; - final PlatformUserChoiceDetails arg_details = args[0]! as PlatformUserChoiceDetails; + final PlatformUserChoiceDetails arg_details = + args[0]! as PlatformUserChoiceDetails; try { api.userSelectedalternativeBilling(arg_details); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString()), + ); } }); }