findSlot method

Slot? findSlot(
  1. String slotName
)

Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it repeatedly.

Implementation

Slot? findSlot(String slotName) {
  final nameNative = slotName.toNativeUtf8(allocator: _allocator);
  final slot = _bindings.spine_skeleton_find_slot(_skeleton, nameNative.cast());
  _allocator.free(nameNative);
  if (slot.address == nullptr.address) return null;
  return Slot._(slot);
}