getAttachment method

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

Implementation

Attachment? getAttachment(int slotIndex, String attachmentName) {
  final attachmentNameNative = attachmentName.toNativeUtf8(allocator: _allocator);
  final attachment = _bindings.spine_skeleton_get_attachment(_skeleton, slotIndex, attachmentNameNative.cast());
  _allocator.free(attachmentNameNative);
  if (attachment.address == nullptr.address) return null;
  return Attachment._toSubclass(attachment);
}