You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wildcarding assets in pubspec.yaml (or allow an entire directory to be included) #4890
changed the title [-]FR: Wildcarding assets in flutter.yaml (or allow an entire directory to be included)[/-][+]FR: Wildcarding assets in pubspec.yaml (or allow an entire directory to be included)[/+]on Jan 31, 2017
changed the title [-]FR: Wildcarding assets in pubspec.yaml (or allow an entire directory to be included)[/-][+]Wildcarding assets in pubspec.yaml (or allow an entire directory to be included)[/+]on Jan 31, 2017
Looks like the fix is in the analysis server, so VS Code doesn't require any changes. You'll get the fix when you get a new Flutter that has a new SDK in it (same as for IntelliJ) 😄
Reacted by Günter Zöchbauer, Alexey Smirnov, David Frey and Aleksa Savić
@DanTup hey I was going through dart-lang/sdk#33550 but that's a workaround. Are you aware of a definitive fix for this? if not, I'd like to open new ticket/reopen the above one, and in the mean time add the workaround above in the documentation as a PR.
@DanTup awesome :)
Is there a easy way to know when that change trickles down to flutter master, without checking dart commit hash with flutter --version and cloning dart to track it? I understand the idea but not sure if there's an easy way to know, and occasionally people come to me asking about this issue.
I understand that is not usually needed though.
Bot idea: register your email for when a given dart/flutter commit reaches master / dev / beta
You can see this one says dev.63. So it's not in master yet, but you should be able to tell when it is fairly easily.
Bot idea: register your email for when a given dart/flutter commit reaches master / dev / beta
Yeah, a generic GitHub bot you can mention on an issue that pings you when it hits a release would be awesome; but hard to implement (hard to generically tie issues to releases). A more specific one (eg. just Flutter) would be easier, but less awesome!
Guys, the only issue with this new implementation ending the folder name with a slash is that it only gets the parent folder but not it's children, it would be good to be able to do this recursively since I'm trying to package a web application there during the migration to flutter.
Something like assets/**/ or assets/**/*.
Reacted by Ori Schwartz, Hugo Delaunay, Ihor Klimov, JGTM'2026, Kent Boogaart, Saurav Rastogi, HiroyukiTamura, Wojciech Rozwadowski, Koen Van Looveren, Aleksa Savić and 22 more
I'm a member of Fly-Mix Team from NetEase company. My team did develop a flutter development tool: Flr(Flutter-R) to support the feature that you want.
Flr is a flutter resource manager tool, which can help flutter developer to auto specify assets in pubspec.yaml and generate r.g.dart file which likes R.java in Android after he changes the flutter project assets. With r.g.dart, flutter developer can apply the asset in code by referencing it's asset ID function, such as:
Hey guys. Can we expect this to be implemented in the foreseeable future? There are numerous cases I can think of, in which an asset directory along with its sub directories and the files (or short: recursive definition of asset files) is totally necessary. It's very cumbersome to let an external tool do that.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-]FR: Wildcarding assets in flutter.yaml (or allow an entire directory to be included)[/-][+]FR: Wildcarding assets in pubspec.yaml (or allow an entire directory to be included)[/+][-]FR: Wildcarding assets in pubspec.yaml (or allow an entire directory to be included)[/-][+]Wildcarding assets in pubspec.yaml (or allow an entire directory to be included)[/+]eseidelGoogle commentedon Mar 10, 2017
Here is the handling of the
assetskey, probably pretty easy to add this (and make other improvements to this logic):https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/asset.dart#L343
eseidelGoogle commentedon May 11, 2017
We're looking to remove .flx files entirely in #9900 which will likely change how we specify assets.
dragonfax commentedon Oct 18, 2017
Still no solution for this? I have a lot of images in my app, and I'm adding more all the time.
38 remaining items
zoechi commentedon Jun 26, 2018
@bunopus seems to be only in
masteryet. See #16413You also need flutter/flutter-intellij#2384 which will probably included in the next Flutter IntelliJ plugin update.
Not sure about VSCode @DanTup do you know about that?
bunopus commentedon Jun 26, 2018
@zoechi thanks! Found related bug dart-lang/sdk#33550
Ignore it for now, but it's really confusing, because it's in the docs on https://flutter.io/assets-and-images/
DanTup commentedon Jun 26, 2018
Looks like the fix is in the analysis server, so VS Code doesn't require any changes. You'll get the fix when you get a new Flutter that has a new SDK in it (same as for IntelliJ) 😄
fmatosqg commentedon Jul 10, 2018
@DanTup hey I was going through dart-lang/sdk#33550 but that's a workaround. Are you aware of a definitive fix for this? if not, I'd like to open new ticket/reopen the above one, and in the mean time add the workaround above in the documentation as a PR.
DanTup commentedon Jul 10, 2018
@fmatosqg The issue is fixed (dart-lang/sdk@d895b49 - it's linked in dart-lang/sdk#33550 (comment)) - the workaround is a temporary fix you can use until you get a version of Flutter that includes the fix.
fmatosqg commentedon Jul 10, 2018
@DanTup awesome :)
Is there a easy way to know when that change trickles down to flutter master, without checking dart commit hash with
flutter --versionand cloning dart to track it? I understand the idea but not sure if there's an easy way to know, and occasionally people come to me asking about this issue.I understand that is not usually needed though.
Bot idea: register your email for when a given dart/flutter commit reaches master / dev / beta
DanTup commentedon Jul 10, 2018
@fmatosqg If you click on the changeset above, you can see the tags shown on GitHub:
The oldest one there is the one you care about (dev64 in this case).
When you run
flutter --version, it includes the Dart SDK version:You can see this one says
dev.63. So it's not in master yet, but you should be able to tell when it is fairly easily.Yeah, a generic GitHub bot you can mention on an issue that pings you when it hits a release would be awesome; but hard to implement (hard to generically tie issues to releases). A more specific one (eg. just Flutter) would be easier, but less awesome!
jayrmotta commentedon Jul 24, 2018
Guys, the only issue with this new implementation ending the folder name with a slash is that it only gets the parent folder but not it's children, it would be good to be able to do this recursively since I'm trying to package a web application there during the migration to flutter.
Something like
assets/**/orassets/**/*.fmatosqg commentedon Jul 24, 2018
Hey,
You can read the comments on the pr, there I explain why the approach you mention is a big risk for breaking backwards compatibility in the future.
Also, web! = flutter. There are assumptions made in the specs that are unique to flutter.
YK-Unit commentedon Feb 26, 2020
Hi, all:
I'm a member of Fly-Mix Team from NetEase company. My team did develop a flutter development tool:
Flr(Flutter-R)to support the feature that you want.Flris a flutter resource manager tool, which can help flutter developer to auto specify assets inpubspec.yamland generater.g.dartfile which likesR.javain Android after he changes the flutter project assets. Withr.g.dart, flutter developer can apply the asset in code by referencing it's asset ID function, such as:PS: yes, it is just like the AAPT(Android Asset Packaging Tool) in Android.
Up to now, Flr has supported Android Studio Plugin, CLI, and VSCode Extension:
Flr Android Studio Plugin Version
GitHub: https://github.com/Fly-Mix/flr-as-plugin
Plugin Homepage: https://plugins.jetbrains.com/plugin/13789-flr
flr-as-plugin Usage Example Gif:
Flr CLI Version
GitHub: https://github.com/Fly-Mix/flr-cli
CLI Homepage: https://rubygems.org/gems/flr
flr-cli Usage Example Gif:
Flr VSCode Extension Version
GitHub: https://github.com/Fly-Mix/flr-vscode-extension
Extension Homepage: https://marketplace.visualstudio.com/items?itemName=LincolnLaw.flr
flr-vscode-extension Usage Example:
flutter-clutter commentedon Mar 23, 2021
Hey guys. Can we expect this to be implemented in the foreseeable future? There are numerous cases I can think of, in which an asset directory along with its sub directories and the files (or short: recursive definition of asset files) is totally necessary. It's very cumbersome to let an external tool do that.
github-actions commentedon Aug 4, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.