Embedding Rive Assets and Controllers
Load .riv files and drive playback through Rive artboards and animation controllers.
What Rive Brings to Flutter
Rive is a real-time interactive design tool. Its runtime exports a compact binary file with the .riv extension that contains vector art, bones, timelines, and state machines.
- The
riveDart package renders these files natively on the GPU, so animations stay crisp at any resolution. - Unlike Lottie, Rive can run state machines driven by runtime inputs, making animations interactive rather than just playback-only.
In this lesson you will load a .riv asset, pick an artboard, and drive playback with an animation controller.
Adding the Dependency and Asset
First declare the package in pubspec.yaml and register the binary file under assets so Flutter bundles it.
- The version constraint targets Rive 0.13.x, which exposes the
RiveAnimationwidget and the controller APIs used below. - The asset path is relative to the project root; any file inside a declared folder is included.
dependencies:
flutter:
sdk: flutter
rive: ^0.13.1
flutter:
assets:
- assets/rive/vehicles.rivAll lessons in this course
- Embedding Rive Assets and Controllers
- State Machines and Input-Driven Motion
- Hero Transitions and Shared Element Motion
- Staggered and Choreographed AnimationControllers