spine-flutter

The spine-flutter runtime provides functionality to load, manipulate and render Spine skeletal animation data using Flutter. spine-flutter is based on spine-c and supports desktop, mobile, and web Flutter deployment targets.

See the spine-flutter documentation for in-depth information.

Licensing

You are welcome to evaluate the Spine Runtimes and the examples we provide in this repository free of charge.

You can integrate the Spine Runtimes into your software free of charge, but users of your software must have their own Spine license. Please make your users aware of this requirement! This option is often chosen by those making development tools, such as an SDK, game toolkit, or software library.

In order to distribute your software containing the Spine Runtimes to others that don't have a Spine license, you need a Spine license at the time of integration. Then you can distribute your software containing the Spine Runtimes however you like, provided others don't modify it or use it to create new software. If others want to do that, they'll need their own Spine license.

For the official legal terms governing the Spine Runtimes, please read the Spine Runtimes License Agreement and Section 2 of the Spine Editor License Agreement.

Spine version

spine-flutter works with data exported from Spine 4.3.xx.

spine-flutter supports all Spine features, except two-color tinting and the screen blend mode.

Supported platforms

The spine-flutter runtime works on desktop, mobile and web.

Setup

To add spine_flutter to your Flutter project, add the following dependency to your pubspec.yaml file:

dependencies:
  ...
  # See https://pub.flutter-io.cn/packages/spine_flutter for the latest version
  spine_flutter: ^4.3.0

In your main(), add this line in the beginning to initialize the Spine Flutter runtime:

void main() async {
    await initSpineFlutter(enableMemoryDebugging: false);
    ...
}

Example

You can run the example like this:

  1. install the Flutter SDK, then run flutter doctor which will instruct you what other dependencies to install.
  2. Clone this repository git clone https://github.com/esotericsoftware/spine-runtimes
  3. Run setup.sh in the spine-flutter/ folder. On Windows, you can use Git Bash included in Git for Window to run the setup.sh Bash script.

You can then open spine-flutter in an IDE or editor of your choice that supports Flutter, like IntelliJ IDEA/Android Studio or Visual Studio Code to inspect and run the example.

Alternatively, you can run the example from the command line.

Development

Run ./setup.sh to copy over the spine-cpp and spine-c sources. This step needs to be executed every time spine-cpp or spine-c changes.

If all you modify are the Dart sources of the plugin, then the development setup is the same as the setup described under "Example" above.

If you need to update or modify the bindings generated from spine-c, run ./generate-bindings.sh. If you regenerate the bindings, you must also compile the WASM binaries via ./compile-wasm.sh.

Run ./publish.sh to publish spine-flutter to pub.flutter-io.cn.

The ./tests folder contains headless tests that exercise the bindings to spine-c.

Libraries

generated/alpha_timeline
generated/animation
generated/animation_state
generated/animation_state_data
generated/api
generated/arrays
generated/atlas
generated/atlas_attachment_loader
generated/atlas_page
generated/atlas_region
generated/attachment
generated/attachment_loader
generated/attachment_timeline
generated/attachment_type
generated/blend_mode
generated/bone
generated/bone_data
generated/bone_local
generated/bone_pose
generated/bone_timeline
generated/bone_timeline1
generated/bone_timeline2
generated/bounding_box_attachment
generated/clipping_attachment
generated/color
generated/constraint
generated/constraint_data
generated/constraint_timeline
generated/constraint_timeline1
generated/curve_timeline
generated/curve_timeline1
generated/deform_timeline
generated/draw_order_timeline
generated/event
generated/event_data
generated/event_queue_entry
generated/event_timeline
generated/event_type
generated/format
generated/from_property
generated/from_rotate
generated/from_scale_x
generated/from_scale_y
generated/from_shear_y
generated/from_x
generated/from_y
generated/ik_constraint
generated/ik_constraint_base
generated/ik_constraint_data
generated/ik_constraint_pose
generated/ik_constraint_timeline
generated/inherit
generated/inherit_timeline
generated/linked_mesh
generated/mesh_attachment
generated/mix_blend
generated/mix_direction
generated/path_attachment
generated/path_constraint
generated/path_constraint_base
generated/path_constraint_data
generated/path_constraint_mix_timeline
generated/path_constraint_pose
generated/path_constraint_position_timeline
generated/path_constraint_spacing_timeline
generated/physics
generated/physics_constraint
generated/physics_constraint_base
generated/physics_constraint_damping_timeline
generated/physics_constraint_data
generated/physics_constraint_gravity_timeline
generated/physics_constraint_inertia_timeline
generated/physics_constraint_mass_timeline
generated/physics_constraint_mix_timeline
generated/physics_constraint_pose
generated/physics_constraint_reset_timeline
generated/physics_constraint_strength_timeline
generated/physics_constraint_timeline
generated/physics_constraint_wind_timeline
generated/point_attachment
generated/polygon
generated/posed
generated/posed_active
generated/posed_data
generated/position_mode
generated/property
generated/region_attachment
generated/render_command
generated/rgb2_timeline
generated/rgb_timeline
generated/rgba2_timeline
generated/rgba_timeline
generated/rotate_mode
generated/rotate_timeline
generated/rtti
generated/scale_timeline
generated/scale_x_timeline
generated/scale_y_timeline
generated/sequence
generated/sequence_mode
generated/sequence_timeline
generated/shear_timeline
generated/shear_x_timeline
generated/shear_y_timeline
generated/skeleton
generated/skeleton_binary
generated/skeleton_bounds
generated/skeleton_clipping
generated/skeleton_data
generated/skeleton_json
generated/skeleton_renderer
generated/skin
generated/slider
generated/slider_base
generated/slider_data
generated/slider_mix_timeline
generated/slider_pose
generated/slider_timeline
generated/slot
generated/slot_curve_timeline
generated/slot_data
generated/slot_pose
generated/slot_timeline
generated/spacing_mode
generated/spine_dart_bindings_generated
generated/texture_filter
generated/texture_region
generated/texture_wrap
generated/timeline
generated/to_property
generated/to_rotate
generated/to_scale_x
generated/to_scale_y
generated/to_shear_y
generated/to_x
generated/to_y
generated/track_entry
generated/transform_constraint
generated/transform_constraint_base
generated/transform_constraint_data
generated/transform_constraint_pose
generated/transform_constraint_timeline
generated/translate_timeline
generated/translate_x_timeline
generated/translate_y_timeline
generated/update
generated/vertex_attachment
io_stub
native_array
raw_image_provider
spine_bindings
spine_dart
spine_dart_init
spine_dart_init_web
spine_flutter
spine_widget