1988
1988

Reputation: 329

How to create splash screen for multiple flavours in flutter for both android and ios?

Is there any way for me to create different splash screen for multiple flavor in flutter?

Upvotes: 4

Views: 2535

Answers (1)

mirkancal
mirkancal

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.

enter image description here

By opening the build settings and clicking the tiny + button.

enter image description here

Add a variable, like LAUNCH_SCREEN.

Now we will create another LaunchScreen, by creating new LaunchScreen, like called LaunchScreenFlavor2.

enter image description here

enter image description here

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

Related Questions