findSkin method

Skin? findSkin(
  1. String name
)

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

Implementation

Skin? findSkin(String name) {
  final nativeName = name.toNativeUtf8(allocator: _allocator);
  final skin = _bindings.spine_skeleton_data_find_skin(_data, nativeName.cast());
  _allocator.free(nativeName);
  if (skin.address == nullptr.address) return null;
  return Skin._(skin);
}