Flutter
Requirements and the calls specific to the Miniwall Flutter plugin, 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; set the iOS deployment target to 16.0 and the Android minSdk to 24. Everything in the other 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. Load failures throw with code miniwall_error.
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. If a handler does not answer within 10 minutes, the screen is released as "not bought" (see Callbacks). Use any Flutter billing package inside onPurchase.
Embedding
Inline embedding is available in the native SDKs only. See Embed a screen.