MBTrigger.fromJsonDictionary constructor

MBTrigger.fromJsonDictionary(
  1. Map<String, dynamic> dictionary
)

Initializes a trigger from a JSON dictionary. @param dictionary The JSON dictionary.

Implementation

factory MBTrigger.fromJsonDictionary(Map<String, dynamic> dictionary) {
  String id = dictionary['id'];
  String triggerTypeString = dictionary['type'];
  MBTriggerType triggerType =
      MBTrigger.triggerTypeFromString(triggerTypeString);
  return MBTrigger(
    id: id,
    triggerType: triggerType,
  );
}