# How do I use a Rive state machine in Flutter?

> With the current rive package (0.14.x), load the file with FileLoader, render it with RiveWidgetBuilder, and pick the state machine with StateMachineSelector.byName on a RiveWidgetController. To change what the state machine does from your Dart code, Rive now recommends data binding: bind a view model instance and set its properties. Older tutorials use StateMachineController and SMI inputs from 0.13 and earlier.

Updated November 2026. Source: https://www.exodeui.com/questions/how-to-use-rive-state-machine-in-flutter/

## Key takeaways

- rive 0.14.x rewrote the Flutter API on top of rive_native
- FileLoader + RiveWidgetBuilder handle loading and disposal
- StateMachineSelector.byName picks a state machine
- Data binding (view model properties) is the recommended way to drive it
- Tutorials using StateMachineController and SMIBool are for the legacy API

## Frequently asked questions

### Where did StateMachineController go?

It belongs to the legacy runtime (0.13 and earlier). 0.14 uses RiveWidgetController with selectors and data binding.

### Can I still use state machine inputs?

Rive now recommends data binding for new work. Check the Rive docs for the status of inputs in your version.

### Which renderer should I choose?

Factory.rive uses the Rive renderer; Factory.flutter uses Skia or Impeller. Rive explains the trade-offs in its Flutter docs.

### How do I listen for events from the animation?

Add listeners to view model properties, or use Rive events as described in the Flutter runtime docs.

## Related

- [Rive animation not playing in Flutter](https://www.exodeui.com/questions/rive-animation-not-playing-flutter)
- [Rive Flutter 16 KB page size fix](https://www.exodeui.com/questions/rive-flutter-16kb-page-size-error)
- [Best Flutter animation packages](https://www.exodeui.com/best-flutter-animation-packages)
- [Best Flutter Rive alternative](https://www.exodeui.com/best-flutter-rive-alternative)
