Version 0.14.0
This is a significant update for Rive Flutter. We’ve completely removed all of the Dart code that was used for the Rive runtime and replaced it with our underlying C++ Runtime. See the Rive Native for Flutter page for more details. This has resulted in a numbers of changes to the underlying API, and a large portion of the code base that was previously accessible through Dart is now implemented in C++ through FFI.What’s New in 0.14.0
This release of Rive Flutter adds support for:- Rive Renderer
- Data Binding
- Layouts
- Scrolling
- N-Slicing
- Vector Feathering
- All other features added to Rive that did not make it to the previous versions of Rive Flutter
- Includes the latest fixes and improvements for the Rive C++ runtime
- Adds prebuilt libraries, with the ability to build manually. See the rive_native package for more information
- Removes the
rive_common
package and replaces it withrive_native
All your Rive graphics will still look and function the same as they did before.
Requirements
Dart and Flutter Versions
This release bumps to these versions:Required Setup
Important: You must callRiveNative.init
at the start of your app, or before you use Rive. For example, in main.dart
:
Migration Guide
Quick Migration Checklist
- ✅ Update your
pubspec.yaml
dependencies to use version0.14.0
or later - ✅ Add
RiveNative.init()
to yourmain()
function, or call before using Rive. - ✅ Replace
Rive
andRiveAnimation
widgets withRiveWidget
orRiveWidgetBuilder
- ✅ Update your controllers to use the new API, see
RiveWidgetController
- ✅ Review and update any custom asset loading code
- ✅ Test your graphics and interactions
Removed Classes
The following classes have been completely removed:Rive
andRiveAnimation
widgets → UseRiveWidget
andRiveWidgetBuilder
RiveAnimationController
and its subclasses → UseRiveWidgetController
,SingleAnimationPainter
, andStateMachinePainter
OneShotAnimation
andSimpleAnimation
→ UseSingleAnimationPainter
to play individual animationsStateMachineController
→ UseStateMachine
instead (can be accessed viaRiveWidgetController.stateMachine
)RiveEvent
→ Replaced withEvent
SMITrigger
→ Replaced withTriggerInput
SMIBool
→ Replaced withBooleanInput
SMINumber
→ Replaced withNumberInput
FileAssetLoader
→ Replaced with optional callback when creating aFile
Loading Rive Files
RiveFile
has been removed and replaced with File
. Important changes:
New API
Factory
determines the renderer that will be used. Use Factory.rive
for the Rive renderer or Factory.flutter
for the shipped Flutter renderer (Skia or Impeller).
Vector Feathering only works with the Rive Renderer.
- Creating a Rive File now requires a factory (
Factory.rive
orFactory.flutter
) - Replace
RiveFile.import
withFile.decode()
which returns aFuture<File>
- Replace
mainArtboard
withdefaultArtboard()
- Replace
artboardByName(name)
withartboard(name)
- Replace
RiveFile.network
withFile.url
- Replace
RiveFile.file
withFile.path
Widget Migration
See the updated example app for a complete migration guide, including how to use the newRiveWidget
and RiveWidgetBuilder
APIs.
Old Widget | New Widget | Notes |
---|---|---|
Rive /RiveAnimation | RiveWidget /RiveWidgetBuilder | Direct replacement |
Using RiveWidgetBuilder
Controller Migration
Old Controller | New Controller | Notes |
---|---|---|
RiveAnimationController | RiveWidgetController | Main controller for widgets |
StateMachineController | StateMachine | Direct state machine access |
OneShotAnimation and SimpleAnimation | SingleAnimationPainter | For individual animations |
RiveWidgetController
:
Using RiveWidgetController
Specifying Artboard and State Machine
Handling State Machine Inputs
Consider using Data Binding for more advanced use cases
StateMachineController
has been removed and replaced with StateMachine
. Important changes:
State Machine Inputs: New API
stateMachine
from the RiveWidgetController
:
It is recommended to manually dispose inputs when no longer needed:
input.dispose()
Nested Inputs
You can access nested inputs by providing an optionalpath
parameter:
Nested Inputs
Handling Rive Events
Consider using Data Binding instead of events for more advanced use cases.
RiveEvent
has been removed and replaced with Event
. Event
is a sealed class with two options:
OpenUrlEvent
GeneralEvent
Rive Events: New API
properties
returns Map<String, CustomProperty>
. CustomProperty
is also a sealed class with options:
CustomNumberProperty
CustomBooleanProperty
CustomStringProperty
value
field. On the Event
class, there are convenient accessors:
Layout Changes
BoxFit → Fit
Previously we used Flutter’sBoxFit
class. Now we use our own Fit
which includes an extra option:
Asset Loading Changes
TheFileAssetLoader
class and all its subclasses have been removed:
CDNAssetLoader
LocalAssetLoader
CallbackAssetLoader
FallbackAssetLoader
Out-of-band Asset Loading
Out-of-band Asset Loading: New API
assetLoader
can no longer be an asynchronous lambdaImageAsset.parseBytes(bytes)
→riveFactory.decodeImage(bytes)
orasset.decode(bytes)
FontAsset.parseBytes(bytes)
→riveFactory.decodeFont(bytes)
orasset.decode(bytes)
AudioAsset.parseBytes(bytes)
→riveFactory.decodeAudio(bytes)
orasset.decode(bytes)
ImageAsset.image = value
→ImageAsset.renderImage(value)
(returns boolean)FontAsset.font = value
→FontAsset.font(value)
(returns boolean)AudioAsset.audio = value
→AudioAsset.audio(value)
(returns boolean)
Text Run Updates
We recommend using Data Binding instead to update text at runtime.
TextValueRun
object directly. Use these methods instead to access the String value:
Get/Set Text Run Value
Known Missing Features
These features are not available inv0.14.0
but may be added in future releases:
- Automatic Rive CDN asset loading
speedMultiplier
useArtboardSize
clipRect
isTouchScrollEnabled
dynamicLibraryHelper
Removed Code Paths
All of the “runtime” Dart code has been removed from these paths:src/controllers
src/core
src/generated
rive_core
utilities
Getting Help
If you encounter issues during migration:- Check the Rive Flutter documentation
- Review the Data Binding guide
- Visit the Rive community forums
- Report issues on the GitHub repository