DVPurchaseDevice class

The device half behind DVPurchases.device.

Constructors

DVPurchaseDevice({required List<DVPurchaseProduct> products, required DVStorePolicy policy, DVStoreClient? store, DVPurchaseBackend? backend, DVPurchaseChannel? channel, DateTime clock()?, DVLogger? logger, Future<void> openUrl(Uri url)?, Future<String> openInvoice(Uri url)?})

Properties

changes → Stream<void>
Each time what the device holds changes.
no setter
channel → DVPurchaseChannel
The channel this build sells from.
no setter
hashCode → int
The hash code for this object.
no setterinherited
policy → DVStorePolicy
final
products → List<DVPurchaseProduct>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

buy(DVPurchaseProduct product, {DVStoreOffer? offer, int quantity = 1}) → Future<DVPurchaseOutcome>
dispose() → Future<void>
Stops listening to the store. For a test, or an application tearing its purchases down.
entitled(Entitlement entitlement) → Future<bool>
holds(Entitlement entitlement) → bool
listings() → Future<List<DVStoreListing>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() → Future<void>
Asks the backend what the signed-in person holds. Also starts listening to the store, so calling it at startup is what catches a transaction that completed while the application was closed.
restore() → Future<List<DVPurchaseResult>>
start() → void
Starts listening to the store's updates, once. Called on first use and by dartvel_flutter at startup: StoreKit delivers transactions that completed while the application was closed only to a listener.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

backendResolver ↔ DVPurchaseBackend? Function()?
getter/setter pair
channelResolver ↔ DVPurchaseChannel Function()?
getter/setter pair
invoiceOpener ↔ Future<String> Function(Uri url)?
getter/setter pair
storeResolver ↔ DVStoreClient? Function(DVPurchaseChannel channel)?
Set by dartvel_flutter for the running platform: the store client, the backend over the signed-in session, the channel this build sells from, and how a URL and a Telegram invoice are opened.
getter/setter pair
urlOpener ↔ Future<void> Function(Uri url)?
getter/setter pair