A Flutter web application for playing Rive animations.
- List View: Browse through available Rive animation files
- Player View: Play and view Rive animations in an interactive player
- URL Path Strategy: Direct URL navigation to specific animations
- Web-Only: Optimized for web deployment
- Flutter SDK (3.10.4 or higher)
- A web browser
-
Navigate to the project directory:
cd riveplayer -
Install dependencies:
flutter pub get
- Place your
.rivfiles in theassets/rive/folder - Run the update script to automatically sync the file list:
This will scan
dart run bin/update_rive_files.dart
assets/rive/and update the file list inlib/screens/rive_list_screen.dart
Manual Alternative: You can also manually update the file list in lib/screens/rive_list_screen.dart:
static const List<String> riveFiles = [
'your_file1.riv',
'your_file2.riv',
'your_file3.riv',
];Run in Chrome:
flutter run -d chromeOr run on a different web browser:
flutter run -d edge # Microsoft Edge
flutter run -d web-server # Default browserBuild the web app:
flutter build webThe output will be in the build/web/ directory.
lib/
├── main.dart # App entry point with routing configuration
└── screens/
├── rive_list_screen.dart # Screen showing list of Rive files
└── rive_player_screen.dart # Screen for playing Rive animations
bin/
└── update_rive_files.dart # Script to auto-update file list
assets/
└── rive/ # Place your .riv files here
dart run bin/update_rive_files.dartThis script automatically:
- Scans the
assets/rive/folder for all.rivfiles - Updates the
riveFileslist inlib/screens/rive_list_screen.dart - Sorts files alphabetically
Run this script whenever you add or remove .riv files from the assets folder.
/- Home screen with list of Rive files/player/:fileName- Player screen for specific Rive file
Example: /player/sample1.riv
- rive: ^0.13.14 - Rive runtime for Flutter
- go_router: ^14.7.0 - Declarative routing with URL path strategy
You can create or download Rive animations from:
- Rive Community - Free animations
- Rive Editor - Create your own animations
This project is open source and available under the MIT License.