indexOfTrigger method

int indexOfTrigger(
  1. TriggerConfiguration trigger
)

Returns the index of the trigger in the triggers. Returns -1 if not found.

Implementation

int indexOfTrigger(TriggerConfiguration trigger) {
  // early out if not in the triggers
  if (!triggers.containsValue(trigger)) return -1;
  int index = -1;
  triggers.forEach((key, value) {
    if (trigger == value) index = int.parse(key);
  });
  return index;
}