Code from https://github.com/crazycodeboy/flutter_splash_screen
if you want to customize your own splash screen, you should use this sample for using it.
The way that uses one bitmap and background with theme can't easily customizing like flutter_native_splash package
and even you want to open dialog on it, it's not supporting.
(flutter_native_splash uses their LaunchTheme, showing dialog on it didn't work for me)
but with this sample. you can do it whatever.
the original sample is using old embedding v1.
so I just moved code to new one with MethodChannel on Android.
it has 2 steps showing splash screen
- android: FlutterActivity -> Dialog for customizing -> Dart screen
- ios: LaunchScreen with storyboard -> Dart screen
on ios, we can easily customize the splash screen
on android, use custom xml
- copy and paste folder of android
- MainActivity and SplashScreen in app/main/kotlin folder.
- drawable, layout, values' style. (you can use your own image or others with flutter_activity.xml)
- app/build.gradle (add androidx dependency)
- set LaunchScreen with storyboard, that's it
- copy and past assets folder and update pubspec.yaml
- main.dart
assets:
- assets/images/
in sample, I guess you cannot see your dialog screen(cause it's lightweight)
if you want to see the change more clearly. follow these steps.
- uncomment 40 ~ 45 line in SplashScreen of app/main/kotlin folder
- comment 42 line in main.dart
