Closed jorgecoca closed 3 years ago
I'm also thinking about the best way. If anyone has a good idea, it would be helpful if you could get a pull request.
Hey!
I think a have an idea for a potential solution that might solve that problem.
We could:
FlutterGen
with an additional package
parameter, so that the user can define it as follows:
flutter_gen:
output: lib/generated/
package: my_ui_package
lineLength: 80
integrations:
flutter_svg: true
package
parameter. It would require transforming this constant string value into a parameterized function.package
parameter to the AssetImage.super(assetName, package)
super constructor.Additionally, SVG integration would need to be updated as follows:
Integration.classOutput
getter to method with package
argument.package
as a default value for SvgPicture.package
field.Let me know what you think about that solution @wasabeef @jorgecoca
~I saw that this landed in 3.1.1 but somehow my assets aren't generated with package
parameter:~
Edit: I had installed fluttergen both through brew and pub, older version was overtaking the new one. Fixed by removing one from brew.
Thanks
Hey @jorgecoca
As an app developer following this issue's approach, we want to consume the package's assets. Do we have to set every single image asset as an entry in the consumer app's pubspec.yaml
file? I hope there's a way to overcome this otherwise it would be too verbose.
See this article -> Example 1: shrine_images
-> How an app developer uses the package
.
Hello! 👋
As a developer, I work on packages that need to contain assets. When that happens, those assets need to be referenced in a different way (see links below):
It'd be amazing for
flutter_gen
to support this use case.If you believe this is a valid use case, I'd be more than happy to take a look and come up with a proposal / pull request.
Thank you! 💯