I want to add a Lottie animation as a splash screen in a Flutter Android app. I would like it to start before Flutter draws its first frame, so I'm thinking about doing it natively.
I found two examples online but they both use Flutter's deprecated SplashScreen
:
I get the following warning message during build:
W/FlutterActivityAndFragmentDelegate(23263): A splash screen was
provided to Flutter, but this is deprecated. See
flutter.dev/go/android-splash-migration for migration steps.
Is there any way to do a splash animation like this video that:
- Accepts Lottie format
- Visible during a cold start before Flutter draws its first frame
- Doesn't use the deprecated Flutter SplashScreen
Things tried that didn't work:
- The documentation for Android 12 SplashScreen only seems to works for Animated Vector Drawable (AVD) format animations.
- The flutter_native_splash package doesn't support the Lottie animation format yet, though the documentation states that they would accept a PR adding support.
Video courtesy of flutter_animated_splash_screen.