Comments (21)
Flavor support is working in the flavor branch for projects which already have flavors setup. I'm hoping to add a separate example app which makes use of flavors before merging that branch into master.
from flutter_launcher_icons.
I have created #154 to showcase this functionality.
Can someone review the PR? 👀 @MarkOSullivan94 @slightfoot
from flutter_launcher_icons.
The flutter CLI supports it. It's just a pass through to gradle flavours and to iOS schemas.
I'm reproducing these articles about flavoring right now:
I guess a good idea might be, while taking as base the readme example:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.6.1"
flutter_icons:
android: true
ios: "Example-Icon"
image_path: "assets/icon/icon.png"
image_path_android: "assets/icon/icon_android.png"
image_path_ios: "assets/icon/icon_ios.png"
adaptive_icon_background: "#FFFAFAFA"
adaptive_icon_foreground: "assets/icon/icon-foreground.png"
flavors:
<flavor-name>:
android: true
ios: "<icon name>"
image_path: "<path here>"
image_path_android: "<path here>"
image_path_ios: "<path here>"
adaptive_icon_background: "<color here>"
adaptive_icon_foreground: "<path here>"
by making the flavors node optional older configurations should be compatible with this feature.
from flutter_launcher_icons.
Flavors functionality available for now in the flavors branch thanks to @sestegra for the implementation and @jorgecoca for putting together the example project 🎉
There's currently some merge conflicts preventing it from being merged into master branch right now.
from flutter_launcher_icons.
@matthew-carroll @lifenautjoe it currently works in the flavors branch and I've also spent time trying to fix the merge conflicts between the flavors
branch and master
branch in the develop
branch so it can be merged into master
Just want to do some more testing before merging
@lifenautjoe in the example flavors project you can run any of the following commands which will work:
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-production.yaml
OR
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-development.yaml
OR
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-integration.yaml
For every single flavor you have within your project, you should have a yaml config file for it, in the example project there's 3 flavors:
- production
- integration
- development
from flutter_launcher_icons.
This would be a killer feature... @MarkOSullivan94 were you be able look into this at all?
from flutter_launcher_icons.
See my pull request.
A sample project is available at following repository:
https://github.com/sestegra/flutter_assets_flavors
from flutter_launcher_icons.
@jorgecoca @sestegra For a bit of clarification, is the intended functionality of this feature to automatically rebuild the app launcher icons every time the app is built?
Or do we still need to manually run this command each time we switch from one flavor to another?
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-${flavor_name}.yaml
from flutter_launcher_icons.
It might not be a breaking change, just adding a "flavors" node with all the flavors icons configuration might do the trick.
from flutter_launcher_icons.
I'm not sure I understand where you're coming from.
I did a bit of research and I've found it's possible to have a debug icon and a release icon for Android: https://stackoverflow.com/questions/22875948/how-to-provide-different-android-app-icons-for-different-gradle-buildtypes/22876224#22876224
Are you wanting something like that? Where you can specify a debug flavor?
Or are you just wanting an option to quickly switch between different flavors of launcher icons?
If you do, this is already possible, you could have your image_path and android / ios icon names all specified for the different flavours and then just comment out the ones which you don't want to use. It'll quickly switch between them for you.
from flutter_launcher_icons.
Yes I wanted something like option 1, so that running flutter build --flavor <flavor>
would build the requested flavor with a different icon without having to edit the configuration and re-running flutter pub pub run flutter_launcher_icons:main
. Although it's not only about debug flavoring.
from flutter_launcher_icons.
Unfortunately unless Flutter cmd line tools support that, you wont be able to run flutter build --flavor <flavor>
.
I'll also need to look into how passing cmd line arguments will work as I haven't done that before.
Curious how you would prefer this to be setup within the pubspec.yaml config?
from flutter_launcher_icons.
Related: #130
Will leave this to someone else who has experience with setting up a Flutter project with flavours enabled
from flutter_launcher_icons.
I will add a project with flavors set today ;) If so, do you think we could get this merge soon?
from flutter_launcher_icons.
@jorgecoca @sestegra For a bit of clarification, is the intended functionality of this feature to automatically rebuild the app launcher icons every time the app is built?
Or do we still need to manually run this command each time we switch from one flavor to another?
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-${flavor_name}.yaml
Ok I take back my question. I had not set everything up correctly so it wasn't working as expected! Once I got everything in the right folders and with the correct names, I was able to run flutter pub get
and flutter pub run flutter_launcher_icons:main
and it created all of the correct launcher icon files in the android/app/src/${flavor}/res
directories. The correct assets are loaded when I switch flavors and I would presume that if I update the icons or graphics, I'll need to run this command again, which should be expected anyways. Thanks!
from flutter_launcher_icons.
The sample doesn't work in such way.
I run flutter pub run flutter_launcher_icons:main
Then receive Check that your config file flutter_launcher_icons.yaml has a flutter_icons section
The command flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-${flavor_name}.yaml
generates for all flavors.
from flutter_launcher_icons.
Can anyone summarize where this issue stands? Has the functionality been abandoned? Is it blocked on a technical hurdle?
from flutter_launcher_icons.
I am using it on two projects and everything is fine.
Just a note about confusing way to generate icons for all flavors that you have to run
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-${flavor_name}.yaml
that will generate for all flavors.
from flutter_launcher_icons.
If I get it right, we're supposed to use the branch flavors? Is there any chance that gets merged? Its already a bit behind.
from flutter_launcher_icons.
I'm trying to figure this out but the examples/flavor just contains 3 config .yaml files. What is supposed to be run to generate the flavored assets?
from flutter_launcher_icons.
FWIW, just running this is enough to handle all flavors: flutter pub run flutter_launcher_icons
In case you are wondering why it won't work for you, you may have used an underscore instead of a dash before your flavor name. So flutter_launcher_icons-production.yaml
is good but flutter_launcher_icons_production.yaml
is not.
from flutter_launcher_icons.
Related Issues (20)
- The icon of an application can be dynamically changed within an application
- [BUG] MacOS logo does not change HOT 3
- [FEATURE REQUEST] Transparent Background for Android Icons HOT 1
- [BUG] Can't refresh icon HOT 2
- ic_launcher icon not working for android push notifications HOT 2
- [FEATURE REQUEST] Generate `favicon.ico` for web HOT 1
- [BUG] FormatException: Missing argument for "file".
- [BUG] Execution fails when renaming the default Runner project
- [BUG] Could not find a file named "pubspec.yaml"
- [BUG] ✗ ERROR: NoConfigFoundException No configuration found in flutter_launcher_icons.yaml or in pubspec.yaml. In case file exists in different directory use --file option #0 createIconsFromArguments (package:flutter_launcher_icons/main.dart:75:7) #1 main (file:///C:/Users/ahmed/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_launcher_icons-0.10.0/bin/main.dart:7:26) #2 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:294:33) #3 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)
- [BUG] Unhandled Exception: PlatformException(INVALID_ICON, The resource app_icon could not be found. Please make sure it has been added as a drawable resource to your Android head project., null, null) HOT 1
- [BUG] Could not find a file named "pubspec.yaml" HOT 2
- Dart 2.18.2 is incompatible
- [BUG] Not all futures are awaited so impossible to create a dart custom dart script HOT 1
- [BUG] printStatus not using configured logger HOT 1
- [BUG] Backround color not changing HOT 2
- [BUG] Black screen on Samsung cellphone instead of white screen with icon in the middle? HOT 1
- [BUG] Adaptive Monochrome Icons are not generated HOT 1
- [BUG] icon resolution decreased
- [BUG] Android icon is zoomed in HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_launcher_icons.