getAttachment method

Attachment<Pointer<NativeType>>? getAttachment(
  1. int slotIndex,
  2. String name
)

Returns the attachment for the specified slot index and name, or null.

Implementation

Attachment? getAttachment(int slotIndex, String name) {
  final nativeName = name.toNativeUtf8(allocator: _allocator);
  final attachment = _bindings.spine_skin_get_attachment(_skin, slotIndex, nativeName.cast());
  _allocator.free(nativeName);
  if (attachment.address == nullptr.address) return null;
  return Attachment._toSubclass(attachment);
}