InAppPurchasePlatform class abstract

The interface that implementations of in_app_purchase must implement.

Platform implementations should extend this class rather than implement it as in_app_purchase does not consider newly added methods to be breaking changes. Extending this class (using extends) ensures that the subclass will get the default implementation, while platform implementations that implements this interface will be broken by newly added InAppPurchasePlatform methods.

Inheritance
  • Object
  • PlatformInterface
  • InAppPurchasePlatform

Constructors

InAppPurchasePlatform()
Constructs a InAppPurchasePlatform.

Properties

hashCode int
The hash code for this object.
no setterinherited
purchaseStream Stream<List<PurchaseDetails>>
Listen to this broadcast stream to get real time update for purchases.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buyConsumable({required PurchaseParam purchaseParam, bool autoConsume = true}) Future<bool>
Buy a consumable product.
buyNonConsumable({required PurchaseParam purchaseParam}) Future<bool>
Buy a non consumable product or subscription.
completePurchase(PurchaseDetails purchase) Future<void>
Mark that purchased content has been delivered to the user.
isAvailable() Future<bool>
Returns true if the payment platform is ready and available.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
queryProductDetails(Set<String> identifiers) Future<ProductDetailsResponse>
Query product details for the given set of IDs.
restorePurchases({String? applicationUserName}) Future<void>
Restore all previous purchases.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance InAppPurchasePlatform
The instance of InAppPurchasePlatform to use.
getter/setter pair