### Present Paywall Source: https://pub.dev/documentation/purchases_ui_flutter/latest/index.html Use this to display the paywall. Ensure the package is installed and configured. ```dart await RevenueCatUI.presentPaywall(); ``` -------------------------------- ### onPurchaseStarted Property Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/OriginalTemplatePaywallFooterView/onPurchaseStarted.html This property is a function that gets called when a purchase is initiated. It receives the `Package` object associated with the purchase. ```APIDOC ## onPurchaseStarted Property ### Description A callback function that is executed when the purchase process starts. It receives the `Package` object related to the purchase. ### Type `dynamic Function(Package rcPackage)?` ### Declaration `final Function(Package rcPackage)? onPurchaseStarted;` ``` -------------------------------- ### CustomVariableValue Usage Example Source: https://pub.dev/documentation/purchases_ui_flutter/latest/custom_variable_value/CustomVariableValue-class.html Example of how to use CustomVariableValue to pass custom variables to the `presentPaywall` function. ```APIDOC ## Usage ```dart RevenueCatUI.presentPaywall( customVariables: { 'player_name': CustomVariableValue.string('John'), 'level': CustomVariableValue.number(42), 'is_premium': CustomVariableValue.boolean(true), }, ); ``` In the paywall text (configured in the dashboard), use the `custom.` prefix: ``` Hello {{ custom.player_name }}! ``` ``` -------------------------------- ### Present Customer Center with Callbacks Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchases_ui_flutter/RevenueCatUI/presentCustomerCenter.html Use this method to present the customer center. Provide optional callback handlers to receive lifecycle events. Ensure the method channel handler is set up if you plan to use callbacks. ```dart static Future presentCustomerCenter({ CustomerCenterRestoreStarted? onRestoreStarted, CustomerCenterRestoreCompleted? onRestoreCompleted, CustomerCenterRestoreFailed? onRestoreFailed, CustomerCenterManageSubscriptions? onShowingManageSubscriptions, CustomerCenterRefundRequestStarted? onRefundRequestStarted, CustomerCenterRefundRequestCompleted? onRefundRequestCompleted, CustomerCenterFeedbackSurveyCompleted? onFeedbackSurveyCompleted, CustomerCenterManagementOptionSelected? onManagementOptionSelected, CustomerCenterCustomActionSelected? onCustomActionSelected, CustomerCenterPromotionalOfferSucceeded? onPromotionalOfferSucceeded, }) async { _setMethodChannelHandlerIfNeeded(); final hasCallbacks = onRestoreStarted != null || onRestoreCompleted != null || onRestoreFailed != null || onShowingManageSubscriptions != null || onRefundRequestStarted != null || onRefundRequestCompleted != null || onFeedbackSurveyCompleted != null || onManagementOptionSelected != null || onCustomActionSelected != null || onPromotionalOfferSucceeded != null; await _clearCustomerCenterCallbacks(); if (hasCallbacks) { await _registerCustomerCenterCallbacks( onRestoreStarted: onRestoreStarted, onRestoreCompleted: onRestoreCompleted, onRestoreFailed: onRestoreFailed, onShowingManageSubscriptions: onShowingManageSubscriptions, onRefundRequestStarted: onRefundRequestStarted, onRefundRequestCompleted: onRefundRequestCompleted, onFeedbackSurveyCompleted: onFeedbackSurveyCompleted, onManagementOptionSelected: onManagementOptionSelected, onCustomActionSelected: onCustomActionSelected, onPromotionalOfferSucceeded: onPromotionalOfferSucceeded, ); } await _methodChannel.invokeMethod('presentCustomerCenter'); } ``` -------------------------------- ### PaywallPurchaseLogic() Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchase_logic/PaywallPurchaseLogic/PaywallPurchaseLogic.html Initializes a new instance of the PaywallPurchaseLogic class. This is the primary way to create a PaywallPurchaseLogic object. ```APIDOC ## PaywallPurchaseLogic() ### Description Initializes a new instance of the PaywallPurchaseLogic class. ### Method Constructor ### Parameters None ### Request Example ```dart var paywallLogic = PaywallPurchaseLogic(); ``` ### Response #### Success Response (Instance) - **PaywallPurchaseLogic** (PaywallPurchaseLogic) - A new instance of the PaywallPurchaseLogic class. ``` -------------------------------- ### onPurchaseCompleted Property Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view/PaywallView/onPurchaseCompleted.html This property is a function that gets called when a purchase is completed. It accepts two arguments: customerInfo and storeTransaction. ```APIDOC ## onPurchaseCompleted Property ### Description A callback function that is executed when a purchase is successfully completed. It provides details about the customer and the transaction. ### Type `dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?` ### Usage This property can be set to a function that handles the post-purchase logic. ```dart final Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)? onPurchaseCompleted; ``` ``` -------------------------------- ### OriginalTemplatePaywallFooterView Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/OriginalTemplatePaywallFooterView/OriginalTemplatePaywallFooterView.html Initializes a new instance of the OriginalTemplatePaywallFooterView with various configuration options and callbacks. ```APIDOC ## OriginalTemplatePaywallFooterView Constructor ### Description Constructs an instance of OriginalTemplatePaywallFooterView. This widget is designed to be used in paywall implementations, offering customization through callbacks for various purchase and restore events, as well as a content creator function. ### Parameters #### Constructor Parameters - **key** (Key?): An optional key for widget identification. - **offering** (Offering?): An optional offering object to configure the paywall. - **onPurchaseStarted** (dynamic Function(Package rcPackage)?): Callback function invoked when a purchase process begins. - **onPurchaseCompleted** (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?): Callback function invoked when a purchase is successfully completed. - **onPurchaseCancelled** (dynamic Function()?): Callback function invoked when a purchase is cancelled by the user. - **onPurchaseError** (dynamic Function(PurchasesError)?): Callback function invoked when a purchase encounters an error. - **onRestoreCompleted** (dynamic Function(CustomerInfo customerInfo)?): Callback function invoked when the restore process is successfully completed. - **onRestoreError** (dynamic Function(PurchasesError)?): Callback function invoked when the restore process encounters an error. - **onDismiss** (dynamic Function()?): Callback function invoked when the paywall is dismissed. - **contentCreator** (required Widget Function(double bottomPadding)): A required function that creates the main content of the paywall, receiving a bottom padding value. ``` -------------------------------- ### PaywallPresentationConfiguration Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/paywall_presentation_configuration/PaywallPresentationConfiguration-class.html Initializes a new instance of the PaywallPresentationConfiguration class with optional iOS and Android presentation styles. ```APIDOC ## PaywallPresentationConfiguration ### Description Configures how a paywall is presented on each platform. ### Parameters * **ios** (IOSPaywallPresentationStyle?) - Optional iOS-specific presentation style. * **android** (AndroidPaywallPresentationStyle?) - Optional Android-specific presentation style. Android always presents full screen; this field exists for API symmetry and future use. ``` -------------------------------- ### onRestoreCompleted Property Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/OriginalTemplatePaywallFooterView/onRestoreCompleted.html This property is a function that gets called after a successful restore operation. It allows you to handle the customer information received. ```APIDOC ## onRestoreCompleted Property ### Description Callback for when a restore operation completes successfully. It provides the CustomerInfo object. ### Type `dynamic Function(CustomerInfo customerInfo)?` ### Implementation ```dart final Function(CustomerInfo customerInfo)? onRestoreCompleted; ``` ``` -------------------------------- ### presentCustomerCenter Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchases_ui_flutter/RevenueCatUI-class.html Presents the customer center modally using the native SDKs. Allows for customization of restore and feedback actions. ```APIDOC ## presentCustomerCenter ### Description Presents the customer center modally using the native SDKs. ### Method static Future presentCustomerCenter({ CustomerCenterRestoreStarted? onRestoreStarted, CustomerCenterRestoreCompleted? onRestoreCompleted, CustomerCenterRestoreFailed? onRestoreFailed, CustomerCenterManageSubscriptions? onShowingManageSubscriptions, CustomerCenterRefundRequestStarted? onRefundRequestStarted, CustomerCenterRefundRequestCompleted? onRefundRequestCompleted, CustomerCenterFeedbackSurveyCompleted? onFeedbackSurveyCompleted, CustomerCenterManagementOptionSelected? onManagementOptionSelected, CustomerCenterCustomActionSelected? onCustomActionSelected, CustomerCenterPromotionalOfferSucceeded? onPromotionalOfferSucceeded, }) ### Parameters - `onRestoreStarted` (CustomerCenterRestoreStarted?) - Callback when a restore operation starts. - `onRestoreCompleted` (CustomerCenterRestoreCompleted?) - Callback when a restore operation completes successfully. - `onRestoreFailed` (CustomerCenterRestoreFailed?) - Callback when a restore operation fails. - `onShowingManageSubscriptions` (CustomerCenterManageSubscriptions?) - Callback when the manage subscriptions view is shown. - `onRefundRequestStarted` (CustomerCenterRefundRequestStarted?) - Callback when a refund request starts. - `onRefundRequestCompleted` (CustomerCenterRefundRequestCompleted?) - Callback when a refund request completes successfully. - `onFeedbackSurveyCompleted` (CustomerCenterFeedbackSurveyCompleted?) - Callback when the feedback survey is completed. - `onManagementOptionSelected` (CustomerCenterManagementOptionSelected?) - Callback when a management option is selected. - `onCustomActionSelected` (CustomerCenterCustomActionSelected?) - Callback when a custom action is selected. - `onPromotionalOfferSucceeded` (CustomerCenterPromotionalOfferSucceeded?) - Callback when a promotional offer succeeds. ``` -------------------------------- ### Get String Representation of Value Source: https://pub.dev/documentation/purchases_ui_flutter/latest/custom_variable_value/StringCustomVariableValue/stringValue.html Returns the string representation of the custom variable's value. This is the implementation for the stringValue getter. ```dart @override String get stringValue => value; ``` -------------------------------- ### performPurchase Abstract Method Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchase_logic/PaywallPurchaseLogic/performPurchase.html This abstract method is called when the user initiates a purchase from the paywall. It takes the package the user selected as input and returns the result of the purchase operation. ```APIDOC ## performPurchase abstract method Future performPurchase( 1. Package packageToPurchase ) Called when the user initiates a purchase from the paywall. `packageToPurchase` is the package the user selected. Return the result of the purchase operation. ### Method Signature ```dart Future performPurchase(Package packageToPurchase); ``` ### Parameters #### Path Parameters - **packageToPurchase** (Package) - Required - The package the user selected for purchase. ``` -------------------------------- ### Get String Representation of Value Source: https://pub.dev/documentation/purchases_ui_flutter/latest/custom_variable_value/NumberCustomVariableValue/stringValue.html Returns the string representation of the value. It formats decimal values to integers if they have no fractional part. ```dart @override String get stringValue => value % 1.0 == 0 ? value.toInt().toString() : value.toString(); ``` -------------------------------- ### Get String Representation of Value Source: https://pub.dev/documentation/purchases_ui_flutter/latest/custom_variable_value/BooleanCustomVariableValue/stringValue.html Returns the string representation of the custom variable's value. This is useful for debugging or displaying the value as text. ```dart @override String get stringValue => value.toString(); ``` -------------------------------- ### presentCustomerCenter Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchases_ui_flutter/RevenueCatUI/presentCustomerCenter.html Presents the customer center modally using the native SDKs. Provide callback handlers to receive customer center lifecycle events. All handlers are optional. ```APIDOC ## presentCustomerCenter ### Description Presents the customer center modally using the native SDKs. Provide callback handlers to receive customer center lifecycle events. All handlers are optional. ### Method Signature ```dart static Future presentCustomerCenter({ CustomerCenterRestoreStarted? onRestoreStarted, CustomerCenterRestoreCompleted? onRestoreCompleted, CustomerCenterRestoreFailed? onRestoreFailed, CustomerCenterManageSubscriptions? onShowingManageSubscriptions, CustomerCenterRefundRequestStarted? onRefundRequestStarted, CustomerCenterRefundRequestCompleted? onRefundRequestCompleted, CustomerCenterFeedbackSurveyCompleted? onFeedbackSurveyCompleted, CustomerCenterManagementOptionSelected? onManagementOptionSelected, CustomerCenterCustomActionSelected? onCustomActionSelected, CustomerCenterPromotionalOfferSucceeded? onPromotionalOfferSucceeded, }) ``` ### Parameters - **onRestoreStarted** (CustomerCenterRestoreStarted?) - Optional - Callback when a restore operation starts. - **onRestoreCompleted** (CustomerCenterRestoreCompleted?) - Optional - Callback when a restore operation completes successfully. - **onRestoreFailed** (CustomerCenterRestoreFailed?) - Optional - Callback when a restore operation fails. - **onShowingManageSubscriptions** (CustomerCenterManageSubscriptions?) - Optional - Callback when the manage subscriptions view is about to be shown. - **onRefundRequestStarted** (CustomerCenterRefundRequestStarted?) - Optional - Callback when a refund request operation starts. - **onRefundRequestCompleted** (CustomerCenterRefundRequestCompleted?) - Optional - Callback when a refund request completes successfully. - **onFeedbackSurveyCompleted** (CustomerCenterFeedbackSurveyCompleted?) - Optional - Callback when the feedback survey is completed. - **onManagementOptionSelected** (CustomerCenterManagementOptionSelected?) - Optional - Callback when a management option is selected by the user. - **onCustomActionSelected** (CustomerCenterCustomActionSelected?) - Optional - Callback when a custom action is selected by the user. - **onPromotionalOfferSucceeded** (CustomerCenterPromotionalOfferSucceeded?) - Optional - Callback when a promotional offer is successfully applied. ### Example ```dart await PurchasesFunctions.presentCustomerCenter( onRestoreCompleted: () => print('Restore completed!'), onShowingManageSubscriptions: () => print('Showing manage subscriptions'), ); ``` ``` -------------------------------- ### Create a string custom variable value Source: https://pub.dev/documentation/purchases_ui_flutter/latest/custom_variable_value/CustomVariableValue/CustomVariableValue.string.html Use this constructor to create a custom variable value of type string. No specific setup or imports are required beyond the class definition. ```dart const factory CustomVariableValue.string(String value) = StringCustomVariableValue; ``` -------------------------------- ### PaywallPresentationConfiguration Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/paywall_presentation_configuration/PaywallPresentationConfiguration/PaywallPresentationConfiguration.html Initializes a new instance of the PaywallPresentationConfiguration class. You can optionally provide specific presentation styles for iOS and Android platforms. ```APIDOC ## PaywallPresentationConfiguration Constructor ### Description Constructs a new PaywallPresentationConfiguration with optional iOS and Android presentation styles. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **ios** (IOSPaywallPresentationStyle?) - Optional: The presentation style for iOS. - **android** (AndroidPaywallPresentationStyle?) - Optional: The presentation style for Android. ### Request Example ```dart const paywallConfig = PaywallPresentationConfiguration( ios: IOSPaywallPresentationStyle.bottomSheet, android: AndroidPaywallPresentationStyle.fullscreen, ); ``` ### Response None (This is a constructor) ``` -------------------------------- ### CustomerCenterManageSubscriptions Typedef Definition Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_customer_center_view_method_handler/CustomerCenterManageSubscriptions.html Defines a void function type that is invoked when the customer center shows the manage subscriptions screen. No specific setup or imports are required beyond standard Dart. ```dart typedef CustomerCenterManageSubscriptions = void Function(); ``` -------------------------------- ### OriginalTemplatePaywallFooterView Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/OriginalTemplatePaywallFooterView-class.html Constructor for OriginalTemplatePaywallFooterView. Allows configuration of various callbacks and content. ```APIDOC ## OriginalTemplatePaywallFooterView ### Description View that displays the paywall in footer mode. Not supported in macOS currently. Only available for original template paywalls. Ignored for V2 Paywalls. ### Parameters - **key** (Key?): Controls how one widget replaces another widget in the tree. - **offering** (Offering?): The offering object to be displayed in the paywall. Obtained from `Purchases.getOfferings`. - **onPurchaseStarted** (dynamic Function(Package rcPackage)?): Callback that gets called when a purchase is started. - **onPurchaseCompleted** (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?): Callback that gets called when a purchase is completed. - **onPurchaseCancelled** (dynamic Function()?): Callback that gets called when a purchase is cancelled. - **onPurchaseError** (dynamic Function(PurchasesError)?): Callback that gets called when a purchase fails. - **onRestoreCompleted** (dynamic Function(CustomerInfo customerInfo)?): Callback that gets called when a restore is completed. Note that this may get called even if no entitlements have been granted in case no relevant purchases were found. - **onRestoreError** (dynamic Function(PurchasesError)?): Callback that gets called when a restore fails. - **onDismiss** (dynamic Function()?): Callback that gets called when the paywall wants to dismiss. Currently, after a purchase is completed. - **contentCreator** (required Widget Function(double bottomPadding)): A function that creates the content to be displayed above the paywall. Make sure you apply the given padding to the bottom of your content to avoid overlap. ``` -------------------------------- ### Perform Purchase Abstract Method Signature Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchase_logic/PaywallPurchaseLogic/performPurchase.html This is the abstract method signature for initiating a purchase. It takes the package to purchase as an argument and should return the result of the purchase operation. ```dart Future performPurchase(Package packageToPurchase); ``` -------------------------------- ### Implement Paywall Presentation Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchases_ui_flutter/RevenueCatUI/presentPaywall.html The implementation of the `presentPaywall` method. It invokes a platform channel method to display the paywall, passing relevant data such as offering identifier, custom variables, and presentation style. The result is parsed into a `PaywallResult`. ```dart static Future presentPaywall({ Offering? offering, bool displayCloseButton = false, Map? customVariables, PaywallPresentationConfiguration? presentationConfiguration, }) async { final presentedOfferingContext = offering?.availablePackages .elementAtOrNull(0) ?.presentedOfferingContext; final result = await _methodChannel.invokeMethod('presentPaywall', { 'offeringIdentifier': offering?.identifier, 'presentedOfferingContext': presentedOfferingContext?.toJson(), 'displayCloseButton': displayCloseButton, 'customVariables': convertCustomVariablesToNative(customVariables), // Only send when fullScreen is explicitly requested; omitting the key // lets the native SDK use its default (sheet). This avoids ambiguity // between "key absent" and "key present with false". if (presentationConfiguration?.ios == IOSPaywallPresentationStyle.fullScreen) 'useFullScreenPresentation': true, }); return _parseStringToResult(result); } ``` -------------------------------- ### OriginalTemplatePaywallFooterView Constructor Implementation Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/OriginalTemplatePaywallFooterView/OriginalTemplatePaywallFooterView.html Provides the Dart implementation for the OriginalTemplatePaywallFooterView constructor, initializing its properties. ```dart const OriginalTemplatePaywallFooterView({ Key? key, this.offering, this.onPurchaseStarted, this.onPurchaseCompleted, this.onPurchaseCancelled, this.onPurchaseError, this.onRestoreCompleted, this.onRestoreError, this.onDismiss, required this.contentCreator, }) : super(key: key); ``` -------------------------------- ### PaywallPresentationConfiguration Constants Source: https://pub.dev/documentation/purchases_ui_flutter/latest/paywall_presentation_configuration/PaywallPresentationConfiguration-class.html Predefined configurations for PaywallPresentationConfiguration. ```APIDOC ## Constants ### defaultConfiguration - Type: const PaywallPresentationConfiguration - Description: Default platform behavior (sheet on iOS, full screen on Android). ### fullScreen - Type: const PaywallPresentationConfiguration - Description: Full-screen presentation on all platforms. ``` -------------------------------- ### PaywallView Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view/PaywallView/PaywallView.html The PaywallView constructor allows for the initialization of the paywall UI with various configuration options and callbacks. ```APIDOC ## PaywallView Constructor ### Description Initializes a new instance of the PaywallView widget. ### Parameters #### Constructor Parameters - **key** (Key?): An optional key for the widget. - **offering** (Offering?): The offering details to be displayed in the paywall. - **displayCloseButton** (bool?): Controls the visibility of the close button. - **customVariables** (Map?): A map of custom variables to be used in the paywall. - **purchaseLogic** (PaywallPurchaseLogic?): Logic to handle purchase flows. - **onPurchaseStarted** (dynamic Function(Package rcPackage)?): Callback when a purchase process starts. - **onPurchaseCompleted** (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?): Callback when a purchase is successfully completed. - **onPurchaseCancelled** (dynamic Function()?): Callback when a purchase is cancelled by the user. - **onPurchaseError** (dynamic Function(PurchasesError)?): Callback when a purchase encounters an error. - **onRestoreCompleted** (dynamic Function(CustomerInfo customerInfo)?): Callback when a restore operation is successfully completed. - **onRestoreError** (dynamic Function(PurchasesError)?): Callback when a restore operation encounters an error. - **onDismiss** (dynamic Function()?): Callback when the paywall is dismissed. ### Implementation ```dart const PaywallView({ Key? key, this.offering, this.displayCloseButton, this.customVariables, this.purchaseLogic, this.onPurchaseStarted, this.onPurchaseCompleted, this.onPurchaseCancelled, this.onPurchaseError, this.onRestoreCompleted, this.onRestoreError, this.onDismiss, }) : super(key: key); ``` ``` -------------------------------- ### PaywallView Constructor Implementation Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view/PaywallView/PaywallView.html Provides the implementation for the PaywallView constructor, initializing its properties with the provided arguments. This is used when creating an instance of the PaywallView widget. ```dart const PaywallView({ Key? key, this.offering, this.displayCloseButton, this.customVariables, this.purchaseLogic, this.onPurchaseStarted, this.onPurchaseCompleted, this.onPurchaseCancelled, this.onPurchaseError, this.onRestoreCompleted, this.onRestoreError, this.onDismiss, }) : super(key: key); ``` -------------------------------- ### PaywallViewMethodHandler Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view_method_handler/PaywallViewMethodHandler-class.html Initializes a new instance of the PaywallViewMethodHandler class with various callback functions for purchase and restore events, and optional purchase logic and method channel. ```APIDOC ## PaywallViewMethodHandler Constructor ### Description Initializes a new instance of the PaywallViewMethodHandler class. ### Parameters - **onPurchaseStarted** (dynamic Function(Package rcPackage)?) - Callback for when a purchase process starts. - **onPurchaseCompleted** (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?) - Callback for when a purchase is successfully completed. - **onPurchaseCancelled** (dynamic Function()?) - Callback for when a purchase is cancelled. - **onPurchaseError** (dynamic Function(PurchasesError)?) - Callback for when a purchase encounters an error. - **onRestoreCompleted** (dynamic Function(CustomerInfo customerInfo)?) - Callback for when restoring transactions is completed successfully. - **onRestoreError** (dynamic Function(PurchasesError)?) - Callback for when restoring transactions encounters an error. - **onDismiss** (dynamic Function()?) - Callback for when the paywall view is dismissed. - **purchaseLogic** (PaywallPurchaseLogic?) - Optional purchase logic handler. - **methodChannel** (MethodChannel?) - Optional method channel for communication. ``` -------------------------------- ### PaywallViewMethodHandler Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view_method_handler/PaywallViewMethodHandler/PaywallViewMethodHandler.html Initializes a new instance of the PaywallViewMethodHandler with optional callback functions for purchase events and optional purchase logic or method channel. ```APIDOC ## PaywallViewMethodHandler Constructor ### Description Constructs a new PaywallViewMethodHandler, allowing for the configuration of various callbacks to handle different stages of the user's purchase or restore flow. ### Parameters - **onPurchaseStarted** (dynamic)? - Callback invoked when a purchase attempt begins. - **onPurchaseCompleted** (dynamic)? - Callback invoked when a purchase is successfully completed. It receives `CustomerInfo` and `StoreTransaction`. - **onPurchaseCancelled** (dynamic)? - Callback invoked when a purchase is cancelled by the user. - **onPurchaseError** (dynamic)? - Callback invoked when a purchase encounters an error. It receives `PurchasesError`. - **onRestoreCompleted** (dynamic)? - Callback invoked when a restore operation is successfully completed. It receives `CustomerInfo`. - **onRestoreError** (dynamic)? - Callback invoked when a restore operation encounters an error. It receives `PurchasesError`. - **onDismiss** (dynamic)? - Callback invoked when the paywall UI is dismissed. - **purchaseLogic** (PaywallPurchaseLogic)? - Optional instance of `PaywallPurchaseLogic` to handle purchase-related logic. - **methodChannel** (MethodChannel)? - Optional `MethodChannel` for communication. ``` -------------------------------- ### PaywallFooterView Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/PaywallFooterView-class.html Constructor for the PaywallFooterView class. ```APIDOC ## PaywallFooterView ### Description Constructor for the PaywallFooterView class. ### Parameters - **key** (Key?): Controls how one widget replaces another widget in the tree. - **offering** (Offering?): The offering object to be displayed in the paywall. Obtained from `Purchases.getOfferings`. - **onPurchaseStarted** (dynamic Function(Package rcPackage)?): Callback that gets called when a purchase is started. - **onPurchaseCompleted** (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?): Callback that gets called when a purchase is completed. - **onPurchaseCancelled** (dynamic Function()?): Callback that gets called when a purchase is cancelled. - **onPurchaseError** (dynamic Function(PurchasesError)?): Callback that gets called when a purchase fails. - **onRestoreCompleted** (dynamic Function(CustomerInfo customerInfo)?): Callback that gets called when a restore is completed. Note that this may get called even if no entitlements have been granted in case no relevant purchases were found. - **onRestoreError** (dynamic Function(PurchasesError)?): Callback that gets called when a restore fails. - **onDismiss** (dynamic Function()?): Callback that gets called when the paywall wants to dismiss. Currently, after a purchase is completed. - **contentCreator** (required Widget Function(double bottomPadding)): A function that creates the content to be displayed above the paywall. Make sure you apply the given padding to the bottom of your content to avoid overlap. ``` -------------------------------- ### PaywallPresentationConfiguration Methods Source: https://pub.dev/documentation/purchases_ui_flutter/latest/paywall_presentation_configuration/PaywallPresentationConfiguration-class.html Available methods for the PaywallPresentationConfiguration class. ```APIDOC ## Methods ### toString - Returns: String - Description: A string representation of this object. - Overrides: `Object.toString()` ``` ```APIDOC ### noSuchMethod - Parameters: - invocation (Invocation) - The invocation object. - Returns: dynamic - Description: Invoked when a nonexistent method or property is accessed. - Inherited from: `Object.noSuchMethod()` ``` -------------------------------- ### Paywall Configuration and Logic Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchases_ui_flutter Configure paywall presentation across platforms and implement custom purchase logic. Handles the result of paywall presentations and custom purchase operations. ```APIDOC ## Classes ### PaywallPresentationConfiguration Configures how a paywall is presented on each platform. ### PaywallPurchaseLogic Interface for custom purchase logic when `purchasesAreCompletedBy` is set to `myApp`. ## Enums ### PaywallResult Possible values for the result of a paywall presentation. ### PurchaseLogicResult Result of a custom purchase or restore operation performed by the app. ``` -------------------------------- ### onPurchaseStarted Property Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view_method_handler/PaywallViewMethodHandler/onPurchaseStarted.html This property allows you to define a callback function that will be executed when a purchase process begins. It receives a Package object as an argument. ```APIDOC ## onPurchaseStarted ### Description A callback function that is triggered when a purchase is started. It receives the `Package` object associated with the purchase. ### Type `dynamic Function(Package rcPackage)?` ### Implementation ```dart final Function(Package rcPackage)? onPurchaseStarted; ``` ``` -------------------------------- ### handleMethodCall Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_customer_center_view_method_handler/CustomerCenterViewMethodHandler-class.html Handles incoming method calls for the customer center view. ```APIDOC ## handleMethodCall ### Description Processes a given MethodCall object, executing the corresponding logic for the customer center view. ### Method `handleMethodCall(MethodCall call)` ### Parameters - **call** (MethodCall) - The method call object to handle. ``` -------------------------------- ### PaywallView Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view/PaywallView-class.html Constructs a PaywallView widget with various optional parameters to customize its behavior and appearance. ```APIDOC ## PaywallView Constructor ### Description Initializes a new instance of the PaywallView class. ### Parameters * **key** (Key?) - Optional - Controls how one widget replaces another widget in the tree. * **offering** (Offering?) - Optional - The offering object to be displayed in the paywall. * **displayCloseButton** (bool?) - Optional - Whether to display a close button. Only available for original template paywalls. * **customVariables** (Map?) - Optional - A map of custom variable names to their values for text substitution. * **purchaseLogic** (PaywallPurchaseLogic?) - Optional - Custom purchase logic for handling purchases and restores when `purchasesAreCompletedBy` is set to `myApp`. * **onPurchaseStarted** (dynamic Function(Package rcPackage)?) - Optional - Callback when a purchase is initiated. * **onPurchaseCompleted** (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?) - Optional - Callback when a purchase is successfully completed. * **onPurchaseCancelled** (dynamic Function()?) - Optional - Callback when a purchase is cancelled. * **onPurchaseError** (dynamic Function(PurchasesError)? - Optional - Callback when a purchase encounters an error. * **onRestoreCompleted** (dynamic Function(CustomerInfo customerInfo)?) - Optional - Callback when a restore operation is completed. * **onRestoreError** (dynamic Function(PurchasesError)? - Optional - Callback when a restore operation encounters an error. * **onDismiss** (dynamic Function()? - Optional - Callback when the paywall is dismissed. ``` -------------------------------- ### defaultConfiguration constant Source: https://pub.dev/documentation/purchases_ui_flutter/latest/paywall_presentation_configuration/PaywallPresentationConfiguration/defaultConfiguration-constant.html Provides the default configuration for paywall presentation, utilizing platform-specific styles for iOS and Android. ```APIDOC ## defaultConfiguration constant ### Description Provides the default configuration for paywall presentation. This configuration sets the default platform behavior, which is a sheet on iOS and a full screen on Android. ### Usage ```dart static const defaultConfiguration = PaywallPresentationConfiguration( ios: IOSPaywallPresentationStyle.sheet, android: AndroidPaywallPresentationStyle.fullScreen, ); ``` ### Details - **`ios`**: Configures the presentation style for iOS, set to `.sheet`. - **`android`**: Configures the presentation style for Android, set to `.fullScreen`. ``` -------------------------------- ### PaywallViewMethodHandler Constructor Implementation Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view_method_handler/PaywallViewMethodHandler/PaywallViewMethodHandler.html Provides the implementation for the PaywallViewMethodHandler constructor, assigning the provided arguments to the class instance properties. ```dart const PaywallViewMethodHandler( this.onPurchaseStarted, this.onPurchaseCompleted, this.onPurchaseCancelled, this.onPurchaseError, this.onRestoreCompleted, this.onRestoreError, this.onDismiss, { this.purchaseLogic, this.methodChannel, }); ``` -------------------------------- ### OriginalTemplatePaywallFooterView Constructor Signature Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/OriginalTemplatePaywallFooterView/OriginalTemplatePaywallFooterView.html Defines the parameters for the OriginalTemplatePaywallFooterView constructor, including optional callbacks and a required content creator widget. ```dart const OriginalTemplatePaywallFooterView({ 1. Key? key, 2. Offering? offering, 3. dynamic onPurchaseStarted( 1. Package rcPackage )?, 4. dynamic onPurchaseCompleted( 1. CustomerInfo customerInfo, 2. StoreTransaction storeTransaction )?, 5. dynamic onPurchaseCancelled()?, 6. dynamic onPurchaseError( 1. PurchasesError )?, 7. dynamic onRestoreCompleted( 1. CustomerInfo customerInfo )?, 8. dynamic onRestoreError( 1. PurchasesError )?, 9. dynamic onDismiss()?, 10. required Widget contentCreator( 1. double bottomPadding ), }) ``` -------------------------------- ### CustomerCenterView Constructor Implementation Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_customer_center_view/CustomerCenterView/CustomerCenterView.html Provides the Dart implementation for the CustomerCenterView constructor, initializing its properties. ```dart const CustomerCenterView({ super.key, this.shouldShowCloseButton = true, this.onDismiss, this.onRestoreStarted, this.onRestoreCompleted, this.onRestoreFailed, this.onShowingManageSubscriptions, this.onRefundRequestStarted, this.onRefundRequestCompleted, this.onFeedbackSurveyCompleted, this.onManagementOptionSelected, this.onCustomActionSelected, this.onPromotionalOfferSucceeded, }); ``` -------------------------------- ### handleMethodCall Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view_method_handler/PaywallViewMethodHandler-class.html Handles incoming method calls from the platform, processing them according to the defined logic. ```APIDOC ## handleMethodCall ### Description Handles incoming method calls, processing them asynchronously. ### Method `handleMethodCall(MethodCall call)` ### Parameters - **call** (MethodCall) - The method call object containing the method name and arguments. ### Returns - **Future** - A future that completes when the method call has been processed. ``` -------------------------------- ### PaywallPresentationConfiguration Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/paywall_presentation_configuration/PaywallPresentationConfiguration/PaywallPresentationConfiguration.html Use this constructor to create an instance of PaywallPresentationConfiguration, optionally specifying presentation styles for iOS and Android. ```dart const PaywallPresentationConfiguration({this.ios, this.android}); ``` -------------------------------- ### fullScreen constant Source: https://pub.dev/documentation/purchases_ui_flutter/latest/paywall_presentation_configuration/IOSPaywallPresentationStyle/fullScreen-constant.html Presents the paywall as a full-screen modal. Useful to avoid white areas in landscape orientation. ```APIDOC ## IOSPaywallPresentationStyle.fullScreen ### Description Presents the paywall as a full-screen modal. Useful to avoid white areas in landscape orientation. ### Implementation ```dart static const fullScreen = IOSPaywallPresentationStyle._('fullScreen'); ``` ``` -------------------------------- ### PaywallView Build Method Implementation Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view/PaywallView/build.html This method builds the paywall UI, conditionally rendering platform-specific views for Android and other platforms. It prepares creation parameters including offering details, display options, and purchase logic status. ```dart @override Widget build(BuildContext context) { final presentedOfferingContext = offering?.availablePackages .elementAtOrNull(0) ?.presentedOfferingContext; final creationParams = { 'offeringIdentifier': offering?.identifier, 'presentedOfferingContext': presentedOfferingContext?.toJson(), 'displayCloseButton': displayCloseButton, 'customVariables': convertCustomVariablesToNative(customVariables), 'hasPurchaseLogic': purchaseLogic != null, }; return Platform.isAndroid ? _buildAndroidPlatformViewLink(creationParams) : _buildUiKitView(creationParams); } ``` -------------------------------- ### InternalPaywallFooterView Constructor Implementation Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_internal_paywall_footer_view/InternalPaywallFooterView/InternalPaywallFooterView.html Provides the implementation for the InternalPaywallFooterView constructor, assigning provided parameters to the class members. ```dart const InternalPaywallFooterView({ Key? key, this.offering, this.onPurchaseStarted, this.onPurchaseCompleted, this.onPurchaseCancelled, this.onPurchaseError, this.onRestoreCompleted, this.onRestoreError, this.onDismiss, required this.onHeightChanged, }) : super(key: key); ``` -------------------------------- ### PaywallFooterView Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/PaywallFooterView/PaywallFooterView.html The PaywallFooterView constructor is used to create an instance of the paywall footer view. It accepts various optional callbacks for purchase events and a required content creator function. ```APIDOC ## PaywallFooterView constructor ### Description This constructor creates a `PaywallFooterView` widget. It is deprecated and users should use `OriginalTemplatePaywallFooterView` instead. It allows for customization of purchase-related callbacks and content creation. ### Parameters - **key** (Key?) - Optional - An object that identifies this widget in the widget tree. - **offering** (Offering?) - Optional - The offering details to be displayed. - **onPurchaseStarted** (dynamic Function(Package rcPackage)?) - Optional - Callback function invoked when a purchase process begins. - **onPurchaseCompleted** (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?) - Optional - Callback function invoked when a purchase is successfully completed. - **onPurchaseCancelled** (dynamic Function()?) - Optional - Callback function invoked when a purchase is cancelled by the user. - **onPurchaseError** (dynamic Function(PurchasesError)? - Optional - Callback function invoked when a purchase encounters an error. - **onRestoreCompleted** (dynamic Function(CustomerInfo customerInfo)?) - Optional - Callback function invoked when restoring purchases is completed successfully. - **onRestoreError** (dynamic Function(PurchasesError)? - Optional - Callback function invoked when restoring purchases encounters an error. - **onDismiss** (dynamic Function()?) - Optional - Callback function invoked when the paywall view is dismissed. - **contentCreator** (required Widget Function(double bottomPadding)) - Required - A function that creates the main content of the paywall, receiving bottom padding as an argument. ### Deprecation This constructor is deprecated. Use `OriginalTemplatePaywallFooterView` instead. ``` -------------------------------- ### fullScreen constant Source: https://pub.dev/documentation/purchases_ui_flutter/latest/paywall_presentation_configuration/AndroidPaywallPresentationStyle/fullScreen-constant.html Presents the paywall as a full-screen activity (default Android behavior). ```APIDOC ## AndroidPaywallPresentationStyle.fullScreen ### Description Presents the paywall as a full-screen activity (default Android behavior). ### Implementation ```dart static const fullScreen = AndroidPaywallPresentationStyle._('fullScreen'); ``` ``` -------------------------------- ### Present Customer Center Source: https://pub.dev/documentation/purchases_ui_flutter/latest/index.html Present the customer center modal without any callbacks. This is a simpler way to open the customer center when no specific post-operation handling is needed. ```dart await RevenueCatUI.presentCustomerCenter(); ``` -------------------------------- ### Build Method for InternalPaywallFooterView Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_internal_paywall_footer_view/InternalPaywallFooterView/build.html This method overrides the default build method to construct the widget's UI. It prepares creation parameters and returns a platform-specific view. Use this when you need to define the visual representation of the paywall footer. ```dart @override Widget build(BuildContext context) { final creationParams = { 'offeringIdentifier': offering?.identifier, }; return Platform.isAndroid ? _buildAndroidPlatformViewLink(creationParams) : _buildUiKitView(creationParams); } ``` -------------------------------- ### Present Customer Center with Callbacks Source: https://pub.dev/documentation/purchases_ui_flutter/latest/index.html Display the customer center modal with optional callbacks for restore and refund operations. Handle the results of these operations in your app. ```dart await RevenueCatUI.presentCustomerCenter( onRestoreCompleted: (customerInfo) { // handle restore success }, onRefundRequestCompleted: (productId, status) { // handle refund completion }, ); ``` -------------------------------- ### presentPaywall Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchases_ui_flutter/RevenueCatUI/presentPaywall.html Presents the paywall to the user. This method can be called to display the paywall interface for purchases. It returns a `PaywallResult` indicating the outcome of the presentation. ```APIDOC ## presentPaywall ### Description Presents the paywall as an activity on Android or a modal on iOS. Returns a `PaywallResult` indicating the result of the paywall presentation. ### Method Signature ```dart static Future presentPaywall({ Offering? offering, bool displayCloseButton = false, Map? customVariables, PaywallPresentationConfiguration? presentationConfiguration, }) ``` ### Parameters - **offering** (`Offering?`) - If set, will present the paywall associated with the given Offering. - **displayCloseButton** (`bool`) - Optionally present the paywall with a close button. Only available for original template paywalls. Ignored for V2 Paywalls. Defaults to `false`. - **customVariables** (`Map?`) - A map of custom variable names to their values. These values can be used for text substitution in paywalls using the `{{ custom.variable_name }}` syntax. - **presentationConfiguration** (`PaywallPresentationConfiguration?`) - Optional configuration for how the paywall is presented on each platform. ``` -------------------------------- ### onPurchaseStarted Property Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_view/PaywallView/onPurchaseStarted.html The `onPurchaseStarted` property is a dynamic function that accepts a `Package` object and can be used to perform actions when a purchase is initiated. ```APIDOC ## onPurchaseStarted Property ### Description This property is a callback function that is invoked when a purchase process begins. It receives a `Package` object as an argument, allowing for custom logic to be executed upon purchase initiation. ### Type `dynamic Function(Package rcPackage)?` ### Declaration `final Function(Package rcPackage)? onPurchaseStarted;` ### Usage Example ```dart PaywallView( // ... other properties onPurchaseStarted: (rcPackage) { print('Purchase started for package: ${rcPackage.id}'); // Add custom logic here }, ); ``` ``` -------------------------------- ### InternalPaywallFooterView Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_internal_paywall_footer_view/InternalPaywallFooterView/InternalPaywallFooterView.html The InternalPaywallFooterView constructor allows for the creation of a paywall footer view with various callback functions for purchase and restore events, as well as a required callback for height changes. ```APIDOC ## InternalPaywallFooterView Constructor ### Description Initializes a new instance of the InternalPaywallFooterView class. ### Parameters #### Constructor Parameters - **key** (Key?): An optional key to identify the widget. - **offering** (Offering?): An optional offering object. - **onPurchaseStarted** (dynamic Function(Package rcPackage)?): Callback function invoked when a purchase starts. - **onPurchaseCompleted** (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?): Callback function invoked when a purchase is completed. - **onPurchaseCancelled** (dynamic Function()?): Callback function invoked when a purchase is cancelled. - **onPurchaseError** (dynamic Function(PurchasesError)?): Callback function invoked when a purchase error occurs. - **onRestoreCompleted** (dynamic Function(CustomerInfo customerInfo)?): Callback function invoked when a restore operation is completed. - **onRestoreError** (dynamic Function(PurchasesError)?): Callback function invoked when a restore operation encounters an error. - **onDismiss** (dynamic Function()?): Callback function invoked when the view is dismissed. - **onHeightChanged** (required dynamic Function(double)): Required callback function invoked when the height of the view changes, passing the new height. ### Implementation Example ```dart const InternalPaywallFooterView({ Key? key, this.offering, this.onPurchaseStarted, this.onPurchaseCompleted, this.onPurchaseCancelled, this.onPurchaseError, this.onRestoreCompleted, this.onRestoreError, this.onDismiss, required this.onHeightChanged, }) : super(key: key); ``` ``` -------------------------------- ### Present Paywall Method Signature Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchases_ui_flutter/RevenueCatUI/presentPaywall.html Defines the signature for the `presentPaywall` static method. It accepts an `Offering`, an optional boolean to display a close button, custom variables, and presentation configuration. Returns a `PaywallResult`. ```dart Future presentPaywall({ 1. Offering? offering, 2. bool displayCloseButton = false, 3. Map? customVariables, 4. PaywallPresentationConfiguration? presentationConfiguration, }) ``` -------------------------------- ### CustomerCenterViewMethodHandler Constructor Implementation Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_customer_center_view_method_handler/CustomerCenterViewMethodHandler/CustomerCenterViewMethodHandler.html Provides the implementation for the CustomerCenterViewMethodHandler constructor, assigning the provided optional parameters to the class fields. ```dart const CustomerCenterViewMethodHandler({ this.onDismiss, this.onRestoreStarted, this.onRestoreCompleted, this.onRestoreFailed, this.onShowingManageSubscriptions, this.onRefundRequestStarted, this.onRefundRequestCompleted, this.onFeedbackSurveyCompleted, this.onManagementOptionSelected, this.onCustomActionSelected, this.onPromotionalOfferSucceeded, }); ``` -------------------------------- ### Implement createState for PaywallFooterView Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_paywall_footer_view/OriginalTemplatePaywallFooterView/createState.html This specific implementation of createState is for the PaywallFooterView, returning an instance of _PaywallFooterViewState. The framework may call this method multiple times. ```dart @override State createState() => _PaywallFooterViewState(); ``` -------------------------------- ### InternalPaywallFooterView Methods Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_internal_paywall_footer_view/InternalPaywallFooterView-class.html Methods available on the InternalPaywallFooterView class. ```APIDOC ## InternalPaywallFooterView Methods ### `build` * Signature: `build(BuildContext context) → Widget` * Description: Describes the part of the user interface represented by this widget. ``` -------------------------------- ### InternalPaywallFooterView Constructor Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_internal_paywall_footer_view/InternalPaywallFooterView-class.html Constructor for the InternalPaywallFooterView widget. It accepts optional callbacks for purchase events and a required callback for height changes. ```APIDOC ## InternalPaywallFooterView Constructor ### Description Initializes a new instance of the `InternalPaywallFooterView` class. ### Parameters * `key` (Key?): An optional key to identify the widget. * `offering` (Offering?): An optional offering object. * `onPurchaseStarted` (dynamic Function(Package rcPackage)?): Callback function invoked when a purchase attempt starts. * `onPurchaseCompleted` (dynamic Function(CustomerInfo customerInfo, StoreTransaction storeTransaction)?): Callback function invoked when a purchase is successfully completed. * `onPurchaseCancelled` (dynamic Function()?): Callback function invoked when a purchase is cancelled. * `onPurchaseError` (dynamic Function(PurchasesError)?): Callback function invoked when a purchase error occurs. * `onRestoreCompleted` (dynamic Function(CustomerInfo customerInfo)?): Callback function invoked when a restore operation is successfully completed. * `onRestoreError` (dynamic Function(PurchasesError)?): Callback function invoked when a restore error occurs. * `onDismiss` (dynamic Function()?): Callback function invoked when the paywall is dismissed. * `onHeightChanged` (dynamic Function(double)): Required callback function invoked when the height of the paywall changes. ``` -------------------------------- ### Present Paywall If Needed (Flutter) Source: https://pub.dev/documentation/purchases_ui_flutter/latest/purchases_ui_flutter/RevenueCatUI/presentPaywallIfNeeded.html Use this method to present the paywall if the user doesn't have the specified entitlement. Configure presentation options like offering, close button, custom variables, and iOS-specific presentation style. ```dart static Future presentPaywallIfNeeded( String requiredEntitlementIdentifier, { Offering? offering, bool displayCloseButton = false, Map? customVariables, PaywallPresentationConfiguration? presentationConfiguration, } ) async { final presentedOfferingContext = offering?.availablePackages .elementAtOrNull(0) ?.presentedOfferingContext; final result = await _methodChannel.invokeMethod('presentPaywallIfNeeded', { 'requiredEntitlementIdentifier': requiredEntitlementIdentifier, 'offeringIdentifier': offering?.identifier, 'presentedOfferingContext': presentedOfferingContext?.toJson(), 'displayCloseButton': displayCloseButton, 'customVariables': convertCustomVariablesToNative(customVariables), // Only send when fullScreen is explicitly requested; omitting the key // lets the native SDK use its default (sheet). This avoids ambiguity // between "key absent" and "key present with false". if (presentationConfiguration?.ios == IOSPaywallPresentationStyle.fullScreen) 'useFullScreenPresentation': true, }); return _parseStringToResult(result); } ``` -------------------------------- ### CustomerCenterView Constructor Signature Source: https://pub.dev/documentation/purchases_ui_flutter/latest/views_customer_center_view/CustomerCenterView/CustomerCenterView.html Defines the parameters available for the CustomerCenterView constructor, including optional callbacks and configuration options. ```dart const CustomerCenterView({ 1. Key? key, 2. bool shouldShowCloseButton = true, 3. CustomerCenterOnDismiss? onDismiss, 4. CustomerCenterRestoreStarted? onRestoreStarted, 5. CustomerCenterRestoreCompleted? onRestoreCompleted, 6. CustomerCenterRestoreFailed? onRestoreFailed, 7. CustomerCenterManageSubscriptions? onShowingManageSubscriptions, 8. CustomerCenterRefundRequestStarted? onRefundRequestStarted, 9. CustomerCenterRefundRequestCompleted? onRefundRequestCompleted, 10. CustomerCenterFeedbackSurveyCompleted? onFeedbackSurveyCompleted, 11. CustomerCenterManagementOptionSelected? onManagementOptionSelected, 12. CustomerCenterCustomActionSelected? onCustomActionSelected, 13. CustomerCenterPromotionalOfferSucceeded? onPromotionalOfferSucceeded, }) ```