Flutter
Platform guide for the Miniwall Flutter plugin, covering install, API and how it relates to the native SDKs.
miniwall_flutter is a plugin over the iOS and Android SDKs. Screens are drawn natively; your Dart code passes prices and runs the purchase. It needs Flutter 3.22 or later, iOS 16 or later and Android 7.0 (API 24) or later. Installation shows how to add it.
Everything in the other Mobile SDK pages applies. This page collects what is specific to Flutter.
Calls
| Call | What it does |
|---|---|
Miniwall.configure(apiKey, ...) | Once at startup. Named arguments: apiUrl, locale, colorMode, analytics, attributes, timeoutMs, maxFontScale |
Miniwall.present(source, options:) | source is ScreenSource.placement, .paywallId or .json |
Miniwall.preload(placements) | Loads screens, images and fonts ahead of time |
Miniwall.setAttributes(values) | Audience attributes; null removes one |
Miniwall.reportPurchase(packageId:, paywallId:) | A purchase that finished outside the screen |
Miniwall.reset(placements:) | Forgets the visitor ID and counters |
Miniwall.startAutoPlacements(...) and Miniwall.track(event) | See Auto placements |
ProductInfo.period is 'day', 'week', 'month', 'year', 'lifetime' or {'unit': 'month', 'count': 3}.
PurchaseResult has outcome (purchased, restored, closed, action or skipped), packageId, actionId, reason and answers.
Handlers run in Dart
onPurchase, onRestore, onAction, onAnswer, onOpenUrl and onError are Dart functions. The native screen asks Dart and waits for the answer, and shows its busy spinner meanwhile. A handler that throws is reported to onError. Use any Flutter billing package inside onPurchase.
Embedding
Inline embedding is available in the native SDKs only. See Embed a screen.