MBViewTrigger class

A view trigger that becomes true when a view is viewed n times and the user stays in the view for a tot of seconds.

Inheritance

Constructors

MBViewTrigger({required String id, required String view, required int times, required int secondsOnView})
Initializes a view trigger with the data provided.
MBViewTrigger.fromDictionary(Map<String, dynamic> dictionary)
Initializes a view trigger with the data of the dictionary returned by the APIs.
factory
MBViewTrigger.fromJsonDictionary(Map<String, dynamic> dictionary)
factory

Properties

completionDate DateTime?
If the trigger has been completed this var will have the date the event has been completed.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String
The id of the trigger.
finalinherited
numberOfTimes int?
Counter to keeps track of how many times an event has happened.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondsOnView int
The seconds the user needs to stay in the view.
final
times int
The times the user needs to see the specified view.
final
triggerType MBTriggerType
The type of trigger.
finalinherited
view String
The view name.
final

Methods

isValid(bool fromAppStartup) Future<bool>
If the trigger is valid or not. @param fromAppStartup If the check has been triggered at the app startup @returns If the trigger is valid or not.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
screenViewed(MBAutomationView view) bool
Function called when the user views a view @param view The view viewed. @returns If theis trigger has changed or not.
setCompleted() → void
Sets the trigger as completed. This function set the completionDate of the trigger to now.
toJsonDictionary() Map<String, dynamic>
Converts the trigger to a JSON dictionary. @returns The JSON representation of the trigger.
override
toString() String
A string representation of this object.
inherited
updatedTrigger(MBTrigger newTrigger) MBTrigger
Updates the trigger with the new info; by defaults no action is done. @param newTrigger The new trigger from which info will be copied. @returns The updated trigger.
override

Operators

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