NexusInApp class
In-app messages (OneSignal-style). Fetches the messages meant for this user —
the server applies the audience, assigns the A/B variant and fills in
{{variables}} — then evaluates triggers (session start / custom event) and
frequency caps locally, requests display, and reports impressions/clicks.
Rendering is done by NexusInAppOverlay (default UI) or your own widget
driven by current.
Constructors
- NexusInApp(NexusHttp _http, NexusIdentity _id, NexusConfig _cfg)
Properties
-
active
→ List<
NexusInAppMessage> -
All active in-app messages for the tenant.
no setter
-
current
→ ValueNotifier<
NexusInAppMessage?> -
The message currently requested to display (null when none). The overlay
listens to this.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- onAction ↔ void Function(NexusInAppAction action)?
-
Called when a user taps a button (handle
url/eventactions yourself, e.g. navigate orlaunchUrl). Event-action buttons are also auto-tracked.getter/setter pair - onTrackEvent ↔ void Function(String event)?
-
Wired by the SDK to the analytics
track()forevent-action buttons.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
attachRealtime(
NexusRealtime realtime) → void - Wired by the SDK so a registered test device gets console tests instantly.
-
clearProperties(
[Iterable< String> ? keys]) → void - Remove properties set with setProperties.
-
close(
) → void - Clear the message from the screen.
-
dismiss(
NexusInAppMessage m) → void - Dismiss the current message (X / backdrop tap).
-
dispose(
) → void -
fetch(
) → Future< List< NexusInAppMessage> > - Fetch the active messages; on success, auto-show a session-start message.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onEvent(
String name) → void - Called when an analytics event fires — shows a message triggered by it.
-
setProperties(
Map< String, Object?> properties, {bool refetch = true}) → Future<void> -
Properties for audience targeting and personalisation, on top of the
identify traits:
setProperties({'plan': 'pro', 'coupon': 'SARA20'})matches the console'splanconditions and fills{{coupon}}. Kept for this launch; passrefetch: falseto wait for the next fetch. -
show(
NexusInAppMessage m) → void - Show a specific message now (bypasses trigger, still respects frequency).
-
tapButton(
NexusInAppMessage m, NexusInAppButton b) → void -
Handle a button tap: report the click, surface the action, auto-track
eventactions, copycopyvalues, then dismiss. Tappable images in a designed message come through here too, with the image block's id. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited