findIkConstraint method

IkConstraint? findIkConstraint(
  1. String constraintName
)

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

Implementation

IkConstraint? findIkConstraint(String constraintName) {
  final nameNative = constraintName.toNativeUtf8(allocator: _allocator);
  final constraint = _bindings.spine_skeleton_find_ik_constraint(_skeleton, nameNative.cast());
  _allocator.free(nameNative);
  if (constraint.address == nullptr.address) return null;
  return IkConstraint._(constraint);
}