Comments (3)
A proposal would be to just suffix the variable with a underscore, so do_
, in_
, etc. This will still make it easy to discovery (with IDE autocompletion) and is minimally invasive.
I'll take a look at fixing this for you.
As a FYI If dart-lang/language#271 was approved, we could write `in`
from flutter_gen.
Ok, I spent a little more time on this than I should have :) (and I'm not a maintainer of this project, so I hope they accept the change). My PR is #433
There are a few other issues that cite similar problems, #250, and #346, that will be fixed by my PR.
The strategy is as follows:
- Convert the asset file name, to a valid dart identifier, that is
- Replace non ASCII chars with ASCII.
- Ensure the name starts with a letter (not number or _).
- Style the name per the camelCase or snakeCase rules.
- Use the asset name without extension. If unique and not a dart reserved word use that.
- Use the asset name with extension. If unique and not a dart reserved word use that.
- If there are any collisions, append a underscore suffix to each item until they are unique.
from flutter_gen.
Ok, I spent a little more time on this than I should have :) (and I'm not a maintainer of this project, so I hope they accept the change). My PR is #433
There are a few other issues that cite similar problems, #250, and #346, that will be fixed by my PR.
The strategy is as follows:
Convert the asset file name, to a valid dart identifier, that is
- Replace non ASCII chars with ASCII.
- Ensure the name starts with a letter (not number or _).
- Style the name per the camelCase or snakeCase rules.
Use the asset name without extension. If unique and not a dart reserved word use that.
Use the asset name with extension. If unique and not a dart reserved word use that.
If there are any collisions, append a underscore suffix to each item until they are unique.
I like the general strategy. Let's try it then we can find edges when users start using it, it's not a big deal.
from flutter_gen.
Related Issues (20)
- [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
- Example links in README lead to Page Not Found
- [FR]: Add Localized Asset Generation HOT 2
- [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
- [FR]: Support Asset Transformation 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_gen.