Flare-Flutter

Flutter runtime for Flare, depends on flare_dart.

Installation

Add flare_flutter as a dependency in your pubspec.yaml file. If you plan on writing a custom controller or want access to more of the guts of the library, you will want to also include flare_dart which is the base library responsible for loading, instancing, animating, and doing all the work that happens before rendering in flare_flutter. The examples include use cases for both scenarios.

Exporting for Flutter

Export from Flare with the "Export to Engine" menu. In the Engine dropdown, choose Flutter, and in the Format dropdown your favorite form of compression.

Adding Assets

Once you've exported your file, add the .flr file to your project's Flutter assets.

Example

Take a look at the provided example applications for how to use the FlutterActor widget with an exported Flutter character.

Usage

The easiest way to get started is by using the provided FlareActor widget. This is a stateless Flutter widget that allows for one Flare file with one active animation playing to be embedded in your Flutter App.

You can change the currently playing animation by changing the animation property's name.

You can also specify the mixSeconds to determine how long it takes for the animation to interpolate from the previous one. A value of 0 means that it will just pop to the new animation. A value of 0.5 will mean it takes half of a second to fully mix the new animation on top of the old one.

import 'package:flare_flutter/flare_actor.dart';
class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return new FlareActor("assets/Filip.flr", alignment:Alignment.center, fit:BoxFit.contain, animation:"idle");
  }
}

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

License

See the LICENSE file for license rights and limitations (MIT).

Libraries

asset_provider
base/actor
base/actor_artboard
base/actor_axis_constraint
base/actor_blur
base/actor_bone
base/actor_bone_base
base/actor_color
base/actor_component
base/actor_constraint
base/actor_distance_constraint
base/actor_drawable
base/actor_drop_shadow
base/actor_ellipse
base/actor_event
base/actor_flags
base/actor_ik_constraint
base/actor_image
base/actor_inner_shadow
base/actor_jelly_bone
base/actor_layer_effect
base/actor_layer_effect_renderer
base/actor_mask
base/actor_node
base/actor_node_solo
base/actor_path
base/actor_polygon
base/actor_rectangle
base/actor_root_bone
base/actor_rotation_constraint
base/actor_scale_constraint
base/actor_shadow
base/actor_shape
base/actor_skin
base/actor_skinnable
base/actor_star
base/actor_targeted_constraint
base/actor_transform_constraint
base/actor_translation_constraint
base/actor_triangle
base/animation/actor_animation
base/animation/interpolation/cubic
base/animation/interpolation/cubic_ease
base/animation/interpolation/hold
base/animation/interpolation/interpolator
base/animation/interpolation/linear
base/animation/keyframe
base/animation/property_types
base/binary_reader
base/block_reader
base/block_types
base/dependency_sorter
base/jelly_component
base/json_block_reader
base/json_reader
base/math/aabb
base/math/mat2d
base/math/transform_components
base/math/vec2d
base/path_point
base/stream_reader
base/transform_space
cache
cache_asset
flare
flare_actor
flare_cache
flare_cache_asset
flare_cache_builder
flare_controller
flare_controls
flare_render_box
flare_testing
provider/asset_flare
provider/memory_flare
trim_path