SubscriptionService class

Constructors

SubscriptionService()
factory
SubscriptionService.getInstance()
factory

Properties

currentPurchases List<PurchaseDetails>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
inAppPurchase InAppPurchase
final
notFoundIds List<String>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subscription StreamSubscription<List<PurchaseDetails>>?
getter/setter pair

Methods

buyConsumableProduct(ProductDetails product, {bool autoConsume = true}) Future<void>
Buy a consumable product (coins, gems, lives, etc.). Set autoConsume to true to automatically consume on Android after purchase.
buyNonConsumableProduct(ProductDetails product) Future<void>
Buy a non-consumable product (subscriptions, one-time permanent purchases).
completePendingIosTransactions() Future<void>
completePendingOrErrorPurchase(BuildContext context, String message, {PurchaseDetails? purchaseDetail}) Future<void>
dispose() → void
downgradeOrUpgrade({required BuildContext context, required ProductDetails newProduct, required List<PurchaseDetails> currentPurchases, required String oldProductId}) Future<void>
Handle subscription upgrade/downgrade on Android. On iOS, StoreKit manages this.
handlePurchaseError({required BuildContext context, required PurchaseDetails purchaseDetails}) Future<void>
init(List<String> productIds) Future<bool>
listenToPurchaseUpdates(dynamic onUpdate(List<PurchaseDetails>)) → void
loadProducts() Future<List<ProductDetails>?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
selectedPlan(String expiryDate, List<ProductDetails> products, int selectedItem, List<String> subscriptionProductIds, List<PurchaseDetails> pastPurchases) Future<ProductDetails>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited