findAnimation method

Animation? findAnimation(
  1. String name
)

Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to call it multiple times.

Implementation

Animation? findAnimation(String name) {
  final nativeName = name.toNativeUtf8(allocator: _allocator);
  final animation = _bindings.spine_skeleton_data_find_animation(_data, nativeName.cast());
  _allocator.free(nativeName);
  if (animation.address == nullptr.address) return null;
  return Animation._(animation);
}