PurchaseProvider class abstract

An abstract interface for handling in-app purchases.

This class defines the contract that all purchase provider implementations must adhere to, ensuring a consistent API for interacting with different payment services like Google Play, Apple App Store, etc.

Constructors

PurchaseProvider()

Properties

hashCode → int
The hash code for this object.
no setterinherited
purchaseStream → Stream<List<PurchaseDetailsModel>>
Stream that emits purchase updates.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel(String purchaseOrProductId) → Future<CancelResultModel>
Cancels a purchase.
completePurchase(PurchaseVerificationDtoModel purchase) → Future<CompletePurchaseResultModel>
Completes a purchase transaction.
dispose() → Future<void>
Disposes the purchase provider.
getConsumables(List<PurchaseProductId> productIds) → Future<List<PurchaseProductDetailsModel>>
Retrieves the details of a list of consumables.
getNonConsumables(List<PurchaseProductId> productIds) → Future<List<PurchaseProductDetailsModel>>
Retrieves the details of a list of non-consumables.
getProductDetails(List<PurchaseProductId> productIds) → Future<List<PurchaseProductDetailsModel>>
Retrieves the details of a list of products.
getPurchaseDetails(PurchaseId productId) → Future<PurchaseDetailsModel>
Retrieves the details of a purchase.
getSubscriptions(List<PurchaseProductId> productIds) → Future<List<PurchaseProductDetailsModel>>
Retrieves the details of a list of subscriptions.
init() → Future<MonetizationStoreStatus>
Initializes the purchase provider. Returns true if the provider is initialized successfully, false otherwise.
isStoreInstalled() → Future<bool>
Checks if the store is installed on the device.
isUserAuthorized() → Future<bool>
Checks if the store has authorized user.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openSubscriptionManagement() → Future<void>
Opens the subscription management page.
purchaseNonConsumable(PurchaseProductDetailsModel productDetails) → Future<PurchaseResultModel>
Initiates the purchase flow for a given product.
restorePurchases() → Future<RestoreResultModel>
Restores any previously made non-consumable purchases.
subscribe(PurchaseProductDetailsModel productDetails) → Future<PurchaseResultModel>
Subscribes to a product.
toString() → String
A string representation of this object.
inherited

Operators

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