findSlotIndex method
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;
}