Skip to content

OneTimeTrigger

A trigger that triggers only once during a deployment.

In contrast to ImmediateTrigger, which triggers every time the app is (re)started, this OneTimeTrigger only triggers once during the life-time of a deployment. Useful for triggering e.g., a demographic survey or collecting device information.

Inheritance
Annotations

Constructors

OneTimeTrigger.fromJson

OneTimeTrigger.fromJson(
  1. Map<String, dynamic> json
)

OneTimeTrigger

OneTimeTrigger()

Creates a trigger that triggers once during a deployment.

Properties

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

hasBeenTriggered

bool get hasBeenTriggered

Whether this trigger has been triggered.

triggerTimestamp

DateTime? triggerTimestamp
getter/setter pair

When this trigger was triggered, or null if not yet.

Set by the runtime and saved with the deployment.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.