To display a paywall or onboarding flow designed in the Adapty Flow Builder, first obtain an AdaptyFlow object. Use createFlowView to generate an AdaptyUIFlowView instance, then call presentFlowView to show it to the user.
Key Parameters for createFlowView:
flow: The AdaptyFlow object to render.locale: (Optional) The localization identifier (e.g., en, es). Falls back to the flow's default if the requested locale is unavailable.preloadProducts: If true, the SDK prefetches required products during view assembly.androidEnableSafeArea: (Android only) If true, applies safe-area insets as paddings. Defaults to true.productPurchaseParams: A map of AdaptyProductIdentifier to AdaptyPurchaseParameters for specific product configurations.
Presentation Options:
When calling presentFlowView, you can specify iosPresentationStyle (e.g., AdaptyUIIOSPresentationStyle.fullScreen).
// 1. Create the view
final flowView = await AdaptyUI().createFlowView(
flow: myAdaptyFlow,
locale: 'en',
preloadProducts: true,
);
// 2. Present the view
await AdaptyUI().presentFlowView(flowView);
// 3. Dismiss when finished
await AdaptyUI().dismissFlowView(flowView);