Reputation: 329
Is there any way for me to create different splash screen for multiple flavor in flutter?
Upvotes: 4
Views: 2535
Reputation: 5345
I'll try to edit later for Android, but as for the iOS, here's the process.
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
That's how your LaunchScreen is defined in Info.plist.
Open XCode, add User-Defined Setting.
By opening the build settings and clicking the tiny + button.
Add a variable, like LAUNCH_SCREEN.
Now we will create another LaunchScreen, by creating new LaunchScreen, like called LaunchScreenFlavor2.
Once you create the new launch screen, and assign LAUNCH_SCREEN variable to that storyboards, scroll to the beginning of my answer, and give the variable in Info.plist. Like:
<key>UILaunchStoryboardName</key>
<string>${LAUNCH_SCREEN}</string>
Upvotes: 12