Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make flavor generation easier by not having to specify flavors by name #751

Open
petcupaula opened this issue Nov 16, 2024 · 6 comments · May be fixed by #752
Open

Make flavor generation easier by not having to specify flavors by name #751

petcupaula opened this issue Nov 16, 2024 · 6 comments · May be fixed by #752

Comments

@petcupaula
Copy link

Is your feature request related to a problem? Please describe.
It's frustrating that I need to specify the names of the flavors when generating the splash screens for different flavors.

Describe the solution you'd like
Instead of having to do:
dart run flutter_native_splash:create --flavors development,staging,production
I would like to be able to do:
dart run flutter_native_splash:create -f flutter_native_spash*

Describe alternatives you've considered
Currently need to do some manual work and thus need to write some thorough README files and do checks that things are not missed. Could also do some scripts that generate the names and command and then run it.

Additional context
Proposed solution is inspired by the args that flutter_launcher_icons takes for flavors setup, which would make things easier.

@jonbhanson
Copy link
Owner

Feel free to add a PR, or @vlazdra may be interested in adding this.

@vlazdra
Copy link
Contributor

vlazdra commented Nov 17, 2024

This should be pretty straightforward, might be a good start as a first issue if you'd like to open a PR @petcupaula ? 😃

If not, let me know so I can extend this feature. 😃

@petcupaula
Copy link
Author

@vlazdra Feel free to go ahead with it 😃

@vlazdra
Copy link
Contributor

vlazdra commented Nov 18, 2024

Ok. 😃

Just to be clear you'd like to have the ability to not specify the exact config file but instead provide the asterisks and for the tool to scan all the files and use all that were found as flavors and generate the splash screen for all of them? @petcupaula

That way, if you maybe have many flavors, you wouldn't need to specify the exact file names/flavor names and miss some, and in the future if you add new ones, you won't need to adapt the run script? Am I understanding you correctly on this?

@petcupaula
Copy link
Author

Yes, exactly! A match on all files with the right prefix (flutter_native_splash*) and then splash screens are generated for everything defined in those files.

@vlazdra
Copy link
Contributor

vlazdra commented Nov 27, 2024

Hey @petcupaula I've made the PR for the changes that you desired.

Until Jon responds and approves them (or denies them), if you are willing to help and maybe give some feedback if the changes work, that would be awesome! 😃

To try out the changes in your project, you can add my fork and branch to your project like so:

  flutter_native_splash:
    git:
      url: https://github.com/vlazdra/flutter_native_splash
      ref: generate-all

Then do a flutter pub get and latter on run the command in your root: dart run flutter_native_splash:create --all-flavors

Please make sure you are working with a clean branch in your project. Do not run it if you have uncomited changes on your branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants