MBTrigger class
A general trigger for automation, you should always use and see subclasses of this.
Constructors
- MBTrigger({required String id, required MBTriggerType triggerType})
- Initializes a trigger with an id and a type. @param id The id of the trigger. @param triggerType The type of trigger.
-
MBTrigger.fromDictionary(Map<
String, dynamic> dictionary) -
Initializes a trigger with the data of the dictionary returned by the APIs.
The type of trigger is set to
MBTriggerType.unknown
.factory -
MBTrigger.fromJsonDictionary(Map<
String, dynamic> dictionary) -
Initializes a trigger from a JSON dictionary.
@param dictionary The JSON dictionary.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The id of the trigger.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- triggerType → MBTriggerType
-
The type of trigger.
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.
-
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.
-
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.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
triggerTypeFromString(
String triggerTypeString) → MBTriggerType -
Converts a string to a
MBTriggerType
. @param triggerTypeString The string that represents the trigger type. @returns The MBTriggerType that matches the string, if no match is found it returnsMBTriggerType.unknown
.