/// Product catalogue. Ids must match the entries created in the Play Console - /// prices are **never** hardcoded in the app, the store returns them. /// /// Only [removeAds] is wired into the UI so far (M7c); the rest of the table in /// docs/monetization.md needs the economy that does not exist yet. abstract final class ProductIds { /// Non-consumable: hides interstitials. Rewarded video stays opt-in. static const String removeAds = 'remove_ads'; /// Documents the seasonal pass that will follow in MVP-3. static const String seasonPass = 'season_pass'; /// Consumable hard currency - needs server-side bookkeeping, not wired yet. static const String coresSmall = 'cores_small'; static const Set all = {removeAds, seasonPass, coresSmall}; /// Products the UI offers today. static const Set offered = {removeAds}; } /// One purchasable item as the store describes it. class StoreProduct { const StoreProduct({ required this.id, required this.title, required this.price, this.raw, }); final String id; final String title; final String price; final Object? raw; @override String toString() => '$id ($price)'; } /// State of a purchase event, mapped from the platform. enum PurchaseState { pending, purchased, restored, canceled, error } class PurchaseEvent { const PurchaseEvent({ required this.productId, required this.state, this.error, this.complete = false, this.raw, }); final String productId; final PurchaseState state; final String? error; /// True when the platform waits for `completePurchase` (Play: acknowledge /// within three days, otherwise the purchase is refunded automatically). final bool complete; final Object? raw; }