MBEventTrigger class

An event opening trigger that becomes true if an event happens.

Inheritance

Constructors

MBEventTrigger({required String id, required String event, required int times, Map<String, dynamic>? metadata})
Initializes an event trigger with the data provided.
MBEventTrigger.fromDictionary(Map<String, dynamic> dictionary)
Initializes an event trigger with the data of the dictionary returned by the APIs.
factory
MBEventTrigger.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
event String
The event that needs to happen.
final
hashCode int
The hash code for this object.
no setterinherited
id String
The id of the trigger.
finalinherited
metadata Map<String, dynamic>?
Metadata associated with the event.
final
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
times int
The number of times the event needs to happen.
final
triggerType MBTriggerType
The type of trigger.
finalinherited

Methods

eventHappened(MBAutomationEvent event) Future<bool>
Function called when an event happen. @param event The event that happened. @returns If the trigger has changed.
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
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