PaywallSession class

A paywall's session: its products, the selected one, purchase and restore progress, errors and verified entitlements. values is what its bindings read (product, paywall, entitlements); result completes with a verified purchase or restore, or a close.

Inheritance

Constructors

PaywallSession({required PurchaseService service, required List<ProductSlot> slots, Set<String>? entitlements, void onEvent(String event, String? slot)?, bool ownsService = false, VoidCallback? onDispose, Map<String, Object?> details = const {}})

Properties

details → Map<String, Object?>
More paywall values for its bindings: the placement, the variant, the legal links (Codelessly.paywall.present sets them).
final
entitlements → Set<String>
final
error ↔ String?
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isDisposed → bool
no setter
onDispose → VoidCallback?
final
onEvent → void Function(String event, String? slot)?
Paywall events (product_selected, purchase_start, purchase_success, purchase_fail, restore, close) with the slot.
final
ownsService → bool
Runtime-created sessions own their store adapter. Manually supplied sessions keep the caller’s ownership by default.
final
products ↔ List<PaywallProduct>
getter/setter pair
purchasing ↔ bool
getter/setter pair
restoreResult ↔ String?
getter/setter pair
restoring ↔ bool
getter/setter pair
result → Future<PaywallResult>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedProduct → PaywallProduct?
no setter
selectedSlot ↔ String?
getter/setter pair
service → PurchaseService
final
slots → List<ProductSlot>
final
values → Map<String, Object?>
What its bindings read: product (the selected one), products (each, in slot order), paywall (progress, errors, details) and entitlements.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
close() → void
dispose() → void
Discards any resources used by the object.
override
load() → Future<void>
Loads the store's products and selects the first.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
purchase({String? slot, PurchaseOfferPreference offer = PurchaseOfferPreference.storeDefault}) → Future<void>
purchaseAndWait({String? slot, PurchaseOfferPreference offer = PurchaseOfferPreference.storeDefault}) → Future<PaywallResult>
Waits for the store's verified outcome, cancellation or error, rather than just purchase initiation. Native action chains use this boundary.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
restore() → Future<void>
restoreAndWait() → Future<PaywallResult>
selectProduct(String slot) → void
toString() → String
A string representation of this object.
inherited

Operators

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