* chore(flutter): bump rive_native * chore(flutter): add examples * docs: update changelog fix: recursively check whether an artboard is its ancestor before usi… (#10184) 53fb2577bc * fix: recursively check whether an artboard is its ancestor before using it as the source of a nested artboard fix(wagyu): proper init of Wagyu Render Pass Inputs (#10175) ff8fc66bc4 * proper init of Wagyu Render Pass Inputs * fixed build issues * clang-format * proper black clear color chore: update thumbnailer for new rive building set-up 9fd4961e9b Co-authored-by: Gordon <pggordonhayes@gmail.com>
Rive Flutter
Rive Flutter is a runtime library for Rive, a real-time interactive design tool.
This library allows you to fully control Rive files in your Flutter apps and games.
Table of contents
Overview of Rive
Rive combines an interactive design tool, a new stateful graphics format, a lightweight multi-platform runtime, and a blazing-fast vector renderer. This end-to-end pipeline guarantees that what you build in the Rive Editor is exactly what ships in your apps, games, and websites.
For more information, check out the following resources:
Getting started
To get started with Rive Flutter, check out the following resources:
For more information, see the Runtime sections of the Rive help documentation:
Choosing a Renderer
In Rive Flutter you have the option to choose either the Rive renderer, or the renderer that is used in Flutter (Skia or Impeller).
You choose a desired renderer when creating a Rive File
object. All graphics that are then created from this File
instance will use the selected renderer.
final riveFile = (await File.asset(
'assets/rewards.riv',
// Choose which renderer to use
riveFactory: Factory.rive,
))!;
Options:
Factory.rive
for the Rive rendererFactoy.flutter
for the Flutter renderer
For more information and additional consideration, see Specifying a Renderer.
Note on the Impeller renderer
Starting in Flutter v3.10, Impeller has replaced Skia to become the default renderer for apps on the iOS platform and may continue to be the default on future platforms over time. As such, there is a possibility of rendering and performance discrepencies when using the Rive Flutter runtime with platforms that use the Impeller renderer that may not have surfaced before. If you encounter any visual or performance errors at runtime compared to expected behavior in the Rive editor, we recommend trying the following steps to triage:
- Try running the Flutter app with the
--no-enable-impeller
flag to use the Skia renderer. If the visual discrepancy does not show when using Skia, it may be a rendering bug on Impeller. However, before raising a bug with the Flutter team, try the second point below👇
flutter run --no-enable-impeller
- Try running the Flutter app on the latest master channel. It is possible that visual bugs may be resolved on the latest Flutter commits, but not yet released in the beta or stable channel.
- If you are still seeing visual discrepancies with just the Impeller renderer on the latest master branch, we recommend raising a detailed issue to the Flutter Github repo with a reproducible example, and other relevant details that can help the team debug any possible issues that may be present.
Supported platforms
Platform | Flutter Renderer | Rive Renderer |
---|---|---|
iOS | ✅ | ✅ |
Android | ✅ | ✅ |
macOS | ✅ | ✅ |
Windows | ✅ | ✅ |
Linux | ❌ | ❌ |
Web | ✅ | ✅ |
Be sure to read the platform specific considerations for the Rive Flutter package.
Awesome Rive
For even more examples and resources on using Rive at runtime or in other tools, checkout the awesome-rive repo.
Troubleshooting
The required native libraries should be automatically downloaded during the build step (flutter run
or flutter build
). If you encounter issues, try the following:
- Run
flutter clean
- Run
flutter pub get
- Run
flutter run
Alternatively, you can manually run the rive_native
setup script. In the root of your Flutter app, execute:
dart run rive_native:setup --verbose --clean --platform macos
This will clean the rive_native
setup and download the platform-specific libraries specified with the --platform
flag. Refer to the Platform Support section above for details.
Building rive_native
By default, prebuilt native libraries are downloaded and used. If you prefer to build the libraries yourself, use the --build
flag with the setup script:
flutter clean # Important
dart run rive_native:setup --verbose --clean --build --platform macos
Note
: Building the libraries requires specific tooling on your machine. Additional documentation will be provided soon.
Testing
Shared libraries are included in the download/build process. If you encounter issues using rive_native
in your tests, please reach out to us for assistance.
Contributing
We love contributions and all are welcome! 💙
Issues
- Reach out to us on our Community
- File an issue on the Rive Flutter repository
Rive Flutter Legacy Runtime
You can find the old runtime code here: https://github.com/rive-app/rive-flutter-legacy
The last published Pub release for this code is rive: 0.13.20
.
The majority of the new runtime code now lives in the rive_native package.