RovenueFunnelView class

Hosts the native funnel renderer for placementIdentifier.

The funnel fills whatever space the parent gives it; size it with a SizedBox/Expanded/etc.

Updating a live widget instance

placementIdentifier and locale are live-updatable: changing either on an existing instance (same Key) sends an updateParams call over the view's per-instance method channel (dev.rovenue.flutter/funnel_view_<viewId>) and the native side re-resolves, clearing the previous funnel first. Re-resolving restarts the funnel at its first screen, so change these two only when you mean to start a different funnel. A resolve superseded by a newer one reports nothing.

Drafts

In a debug build on a Sandbox key the placement serves each funnel's latest DRAFT. The native view draws it with a "Draft" badge and keeps it live: an edit in the builder arrives within a few seconds, on the screen you are on when it still exists (onLoaded fires again). A draft that cannot be served reports onUnavailable with its issues.

Whether onUrl is present is decided when the funnel resolves, because its absence changes what the SDK does (a terms link then opens an http(s) address in the system browser). Removing onUrl later takes effect at once, with no restart: URLs stop reaching your code. Adding one later takes effect only on the next resolve (a placementIdentifier or locale change). Swapping any callback closure's identity is picked up automatically, since build always re-reads widget.onXxx.

Inheritance

Constructors

RovenueFunnelView({Key? key, required String placementIdentifier, String? locale, void onLoaded(RovenueFunnelLoaded loaded)?, void onUnavailable(RovenueFunnelUnavailable unavailable)?, void onError(RovenueException error)?, void onScreenChanged(RovenueFunnelScreen screen)?, VoidCallback? onCompleted, VoidCallback? onDismissed, void onUrl(String url)?, void onCustomAction(RovenueFunnelAction action)?, void onPurchase(String url)?, void onWinBackPurchase(String packageIdentifier, String winBackOfferId)?, VoidCallback? onRestore, Map<String, String> values = const <String, String>{}, void onPhotoSelected(String questionKey, FunnelPhotoRef photo)?, FunnelCheckHandler? onCheck})
Creates a funnel view for placementIdentifier.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale → String?
BCP-47 tag the funnel's copy is resolved in. Null follows the device.
final
onCheck → FunnelCheckHandler?
Your photo checker; without it a check applies its whenUnavailable. Presence is decided when the funnel resolves.
final
onCompleted → VoidCallback?
The funnel reached its end. Never fires together with onDismissed.
final
onCustomAction → void Function(RovenueFunnelAction action)?
An action the funnel's author defined for this app to interpret.
final
onDismissed → VoidCallback?
The visitor dismissed the funnel (its close action). Never fires together with onCompleted, and not when the widget is disposed.
final
onError → void Function(RovenueException error)?
Resolving failed (offline with no cache or fallback, an invalid or unsupported config), or a screen did not decode (serverCode FUNNEL_SCREEN_UNDECODABLE). The previous funnel is cleared.
final
onLoaded → void Function(RovenueFunnelLoaded loaded)?
The first screen is on screen. For a draft, fires again after every live-refresh rebuild.
final
onPhotoSelected → void Function(String questionKey, FunnelPhotoRef photo)?
A photo_upload question was answered: its key and the photo on the device. Call Rovenue.releasePhoto once you are done with the file.
final
onPurchase → void Function(String url)?
The funnel wants this package purchased. Call Rovenue.purchase. A purchase the funnel sells at a win-back offer reaches onWinBackPurchase instead when it is set; without it, this one gets the package and buys at the regular price.
final
onRestore → VoidCallback?
The funnel asked for purchases to be restored.
final
onScreenChanged → void Function(RovenueFunnelScreen screen)?
The visible screen changed, including the first.
final
onUnavailable → void Function(RovenueFunnelUnavailable unavailable)?
The view has nothing to draw: an empty or unknown placement, a placement with no target, or a draft that cannot be served (with its issues). The previous funnel is cleared.
final
onUrl → void Function(String url)?
Omit to leave open_url actions INERT; a legal block's terms link then opens only an http(s) address, in the system browser. Presence is sent as hasUrlHandler and decided when the funnel resolves.
final
onWinBackPurchase → void Function(String packageIdentifier, String winBackOfferId)?
The funnel wants this package purchased at its win-back offer (a purchase with "offer": "win_back" the visitor is eligible for). Buy it with Rovenue.purchase(product, winBackOffer:), the offer from Rovenue.eligibleWinBackOffers(product) whose identifier is winBackOfferId (iOS: StoreKit's offer id; Android: "<basePlanId>:<offerId>").
final
placementIdentifier → String
The placement to resolve. A placement that holds no funnel draws nothing here and reports onUnavailable.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
values → Map<String, String>
Values for the funnel's declared externals (an ad's scene, a campaign): trimmed, 512 characters at most, undeclared names dropped. A fresh value overrides a restored one and preselects a defaultFrom question; a changed value resolves again. Never pass personal data: values are written to the on-device session state.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<RovenueFunnelView>
The state that owns this view's per-instance method channel.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited