rive_native 0.0.1-dev.5 rive_native: ^0.0.1-dev.5 copied to clipboard
Rive's native runtime and renderer for Flutter.
rive_native #
Rive Native is a new runtime that allows you to display and interact with Rive graphics in your Flutter app, powered by the Rive Renderer.
Differences between rive_native and the current Rive Flutter runtime are:
rive_native
is driven by Rive's C++ runtime through FFI, no longer through a Dart implementation of that same runtime. This ensures a more consistent experience across platforms and the Rive Editor. It also allows for future performance improvements and new features that are only available in the C++ runtime - such as Responsive Layouts.rive_native
brings the Rive Renderer to Flutter. You can still opt to use the Flutter-based renderer (Dart / Impeller). There will be times when one is preferred over the other. More documentation will be added on how to choose the correct renderer for your use case. If performance is top priority, we recommend using the Rive Renderer. Future, highly requested features, such as glows and shadows, will likely only be supported by the Rive Renderer.
Technical Preview #
This package is currently in technical preview and not all features and platforms from the current Rive Flutter runtime are supported.
We're working on adding support for all major features.
Platform Support #
Platform | Flutter Renderer | Rive Renderer |
---|---|---|
iOS | ✅ | ✅ |
Android | ❌ | ❌ |
macOS | ✅ | ✅ |
Windows | ✅ | ✅ |
Linux | ❌ | ❌ |
Web | ✅ | ✅ |
Emulator support for iOS is currently unavailable. Please use a physical device for testing.
Feature Support #
Runtime features currently supported by rive_native
:
Feature | Support |
---|---|
Set State Machines Inputs | ✅ |
Set State Machines Nested Inputs | ❌ |
Updating Text Runs | ✅ |
Updating Nested Text Runs | ❌ |
Responsive Layouts | ✅ |
Rive Audio | ✅ |
Out-of-Band Assets | ❌ |
Rive Events | ❌ |
Getting Started #
rive_native
is not yet publicly available on Github, but will be. For now, you can pull the source code and example by running:
dart pub unpack rive_native
cd rive_native/example
flutter pub get
flutter run
A higher-level declarative API is being developed to make it easier to work with Rive graphics in your Flutter app.
See the rive_player.dart
file in rive_native/example/rive_player.dart
for an example implementation on how to use this package.
Trouble Shooting #
The relevant native libraries should automatically be downloaded during the build step (flutter run
or flutter build
).
If you encounter difficulties please try the following:
flutter clean
flutter pub get
flutter run
Alternatively you can run the rive_native
setup scripts directly. In the root of your Flutter app, run:
dart run rive_native:setup --verbose --clean --platform macos
This will perform a clean of the rive_native
setup and download the specified platform libraries set with the --platform
flag. See Platform Support above.
Building rive_native
#
By default the prebuilt native libraries will be downloaded and used. Alternatively, you have the option to build
the libraries yourself using rive_native
setup, passing the --build
flag:
flutter clean # important
dart run rive_native:setup --verbose --clean --build --platform macos
This will requires certain tooling to be available on your machine. We'll be providing more documentation soon.
Testing #
Shared libraries are also included in the download/build process. If you encounter difficulties using rive_native
in your tests please reach out to us.