jonbhanson / flutter_native_splash

Automatically generates native code for adding splash screens in Android and iOS. Customize with specific platform, background color and splash image.
https://pub.dev/packages/flutter_native_splash
MIT License
1.28k stars 200 forks source link

Flavor support? #160

Closed EinatK closed 2 years ago

EinatK commented 3 years ago

Do you have flavor support? Expected behavior similar to the launcher icons where I name different files and run the command with a custom file name. I tried that here but failed because it couldn't find the flutter_native_splash section. Is there another way to do it?

jonbhanson commented 3 years ago

@EinatK @pablodenadai @Rameshv @r8 @raymondddenny what platform(s) are you looking for flavor support?

billowapp commented 3 years ago

Plus one here, we're looking to flavor Android and iOS only at this point.

EinatK commented 3 years ago

android & iOS

jamesmoore255 commented 3 years ago

Any update on this?

jonbhanson commented 3 years ago

I plan on implementing this as time permits. Of course, PRs are always welcome if someone needs this soon.

lyledean1 commented 2 years ago

I've done a PR for this https://github.com/jonbhanson/flutter_native_splash/pull/180 @jonbhanson

jonbhanson commented 2 years ago

Thanks for your contribution, @lyledean1, I appreciate it! However, I am not sure that the PR you contributed will provide what the users are looking for. Although your PR allows users to select different input configurations, it does not redirect the outputs accordingly. In Android, for example, the image files for splash screens of different flavors will reside in different directories. This plugin needs to adjust for the different paths of each flavor. flutter_launcher_icons gives a good example of flavor support. I have not taken the time to investigate how iOS would implement flavor support, but I assume it is something similar.

chainchelliah commented 2 years ago

I also looking for this. PR got merged? Would be really helpful if it goes live. Thanks.

jonbhanson commented 2 years ago

@chainchelliah the PR was merged and is live, but it only added the ability to select the config file with a command line argument.

mellowcello77 commented 2 years ago

I have spent 3 days trying to implement a splash for an iOS flavor, looks like the LaunchScreen.storyboard is compulsory for iOS now. The problem I find is that you are limited to one storyboard per target in Xcode. Does anyone have suggestions, I am imagining that a target is needed for each launchscreen, not just a scheme setup change as with the AppIcon settings as it is now.

For schemes only, you can change the "Asset Catalog Launch Image Set Name" in build settings, but this is deprecated now, it would have been an easier solution but I understand why its deprecated. I cant even get another target in iOS to launch my app. To build a launchimage package to support flavors sounds like a challenge. Does anyone have any ideas?

Cheers

mellowcello77 commented 2 years ago

I did some more searching and found this to be useful - https://stackoverflow.com/a/66165654/11865941

ghost commented 2 years ago

To achieve that we need for each target a info.plist (copy the original one and dupplicate for each target). Despite of launch icon, xcode use the same launchScreen for each target. so we need a specifiq plist to select the right one.

elhe26 commented 2 years ago

@jonbhanson, any updates? Thanks for the awesome package.

qusaieilouti99 commented 2 years ago

@jonbhanson do you have plans to add this feature soon? Thanks.

jonbhanson commented 2 years ago

I don't have any plans to add this feature, but PRs are always welcome.

jonbhanson commented 2 years ago

Flavor support has been added in the latest version, which I will push soon. Thanks Vladimir for PR #316!

CodeDoctorDE commented 2 years ago

Can we open another issue for tracking Windows, Linux and Web support?

jonbhanson commented 2 years ago

Can we open another issue for tracking Windows, Linux and Web support?

Sure, feel free.

CodeDoctorDE commented 2 years ago

One issue or per platform?

jonbhanson commented 2 years ago

I think one issue should be enough.