Comments (5)
Hey!
I think a have an idea for a potential solution that might solve that problem.
We could:
- Extend
FlutterGen
with an additionalpackage
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
- Modify _assetGenImageClassDefinition so that it takes
package
parameter. It would require transforming this constant string value into a parameterized function. - Pass the
package
parameter to theAssetImage.super(assetName, package)
super constructor.
Additionally, SVG integration would need to be updated as follows:
- Convert
Integration.classOutput
getter to method withpackage
argument. - Pass
package
as a default value forSvgPicture.package
field.
Let me know what you think about that solution @wasabeef @jorgecoca
from flutter_gen.
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.
from flutter_gen.
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.
from flutter_gen.
Thanks
from flutter_gen.
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
.
from flutter_gen.
Related Issues (20)
- [BUG]: analyzer v6 is not supported HOT 4
- [BUG]: Unable to access the values when build with style: camel_case HOT 1
- [FR]: Support provider(..) for SVG images HOT 1
- [FR]: Asset path as const
- [FR]: Keyword name conflicts. Prefix the names? HOT 3
- Example links in README lead to Page Not Found
- [FR]: Add Localized Asset Generation HOT 1
- [FR]: Configure default image values HOT 1
- [BUG]: Including folders 1.0x, 2.0x, 3.0x, causes exception HOT 3
- [BUG]: The class 'FileSystemEvent' can't be extended HOT 9
- [BUG]: Why some json file doen't convert to LottieGenImage? HOT 4
- [FR]: Parsing colors into several separate classes. HOT 1
- [FR]: Support getting filename HOT 2
- [FR]: Fonts weight HOT 2
- [BUG]: flutter_svg `DefaultSvgTheme` not working
- [FR]: Support for useArtboardSize in RiveAnimation.asset
- [FR]: Conditionally bundling assets based on flavor HOT 3
- [FR]: Support for lottie zip archives
- [FR]: dotLottie support
- [BUG]: Build Issue with FlutterGen When Excluding Paths with Special Characters in Filenames
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_gen.