getAttachmentByName method

Attachment<Pointer<NativeType>>? getAttachmentByName(
  1. String slotName,
  2. String attachmentName
)

Implementation

Attachment? getAttachmentByName(String slotName, String attachmentName) {
  final slotNameNative = slotName.toNativeUtf8(allocator: _allocator);
  final attachmentNameNative = attachmentName.toNativeUtf8(allocator: _allocator);
  final attachment =
      _bindings.spine_skeleton_get_attachment_by_name(_skeleton, slotNameNative.cast(), attachmentNameNative.cast());
  _allocator.free(slotNameNative);
  _allocator.free(attachmentNameNative);
  if (attachment.address == nullptr.address) return null;
  return Attachment._toSubclass(attachment);
}