getAttachmentByName method
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);
}