Cool Rive Background Animation In Flutter Apps

This combines the background image trick android workaround and extends it to put a rive animation in the background.
Background
The problem is while Google does an excellent job at giving you an introduction to widgets; it’s not the techniques you really need to have mastered to develop a professional application and in a mature market. That is my self-assigned job in pushing out medium articles and my flutter design and development book series.
I am finding that by showing the cool visual and animation that I can get you guys and gals to do the boring devOPS and OOP and FP to get you to the point for flutter expert. Some of the subjects covered are:
DevOPS
Tuning A Cheap MS Windows Laptop for Flutter Development https://readmedium.com/tuning-a-cheap-ms-windows-laptop-for-flutter-app-development-572d09cd4d19
Log Driven Learning Flutter https://readmedium.com/log-driven-learning-flutter-d76b49b75a8c
UML Coolness in Flutter https://itnext.io/uml-coolness-in-flutter-6bb14217b5f2
Lint Like A Boss https://itnext.io/lint-like-a-boss-60b85e82c227
McCabe Cycles in Flutter https://readmedium.com/mccabe-cycles-in-flutter-3aa913e19428
Getting Real Code Coverage https://readmedium.com/getting-real-code-coverage-951231afa2bc
Lcov on Windows https://readmedium.com/lcov-on-windows-7c58dda07080
Test Secrets, Test Suites https://itnext.io/test-secrets-test-suites-99f8390b8d4b
How To, Flutter Internal Packages https://itnext.io/how-to-flutter-internal-packages-cad1285fe8c
An Architecture Layout https://readmedium.com/an-architecture-layout-8f414271b2b4
Logging, The Expert Way https://readmedium.com/logging-the-expert-way-5beb5c967e44
Catch Flutter Application Exceptions https://itnext.io/catch-flutter-application-exceptions-cad036d0fd4e
Flutter Perfect SetUp https://readmedium.com/flutter-perfect-setup-c5462b412f78
Cool Flutter Docs https://readmedium.com/cool-flutter-docs-383b951d7feb
Visual
Animations Users Love(rive) https://readmedium.com/animations-users-love-75a57a8cad5
Full Flutter Background Trick https://readmedium.com/full-flutter-background-trick-d1ea813470d2
Since, my articles appear in multiple publications the best way to keep updated to those posting is to join one of these social platforms and follow me using my profile links:
LinkedIN https://www.linkedin.com/in/fredgrottstartupfluttermobileappdesigner/
Xing https://www.xing.com/profile/Fred_Grott/cv
Discord https://discordapp.com/users/9388/
Gitter(join this forum to get the article links) https://gitter.im/flutter/flutter
Slack https://app.slack.com/client/TGT6YF2J1/CGS4QDJ56/user_profile/UHK8PNRGU
Twitter https://twitter.com/fredgrott
Medium https://fredgrott.medium.com
Reddit FlutterDev Subedit(just join this forum and you will get the notices via reddit) https://www.reddit.com/r/FlutterDev/
As always, the code to both the articles and the books can be found at:
flutter design and arch rosetta at Github https://github.com/fredgrott/flutter_design_and_arch_rosetta
And, the plugins I contribute to are
Flutter Platform Widgets https://github.com/stryder-dev/flutter_platform_widgets
Flutter Rive(player) Plugin https://github.com/rive-app/rive-flutter
In The Beginning
In the beginning, we have the same exact trick as in the article:
Full Flutter Background Trick https://readmedium.com/full-flutter-background-trick-d1ea813470d2
This time we are going to instead use a rive animation.
The Animation
The animation I am using is by Bobbeh at:
https://rive.app/community/224-424-luke-vs-darth/
Now for some rive basics.
Rive sources can be svg images, Lottie files, and flame flr files. And, you use the rive studio to load them and animate them, Then you export the file as a riv file.
Each riv file has one blackboard but can have multiple artboards. Thus, typically to create an app bar you will have the entry and exit animations as paired in one artboard and usually, each artboard is a step and thus one riv file for a full app bar.
Now for some code.
Code Tricks
The patterns I am re-using are from the rive_loading plugin by Jimmy Aumard. Jimmy has set up a less error-prone approach to loading the riv file and playing it on the rive-player in flutter.
I modified Jimmy’s controller code as there are three enum values the animation loop can have, namely oneShot, loop, and pingPong:






