findSlotIndex method

int findSlotIndex(
  1. String slotName
)

Implementation

int findSlotIndex(String slotName) {
  if (slotName.isEmpty) throw ArgumentError('slotName cannot be empty.');
  final List<SlotData> slots = this.slots;
  final int n = slots.length;
  for (int i = 0; i < n; i++) {
    if (slots[i].name == slotName) return i;
  }
  return -1;
}