-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【Feedback】意见反馈 #6
Comments
This project is not the flutter project! 好像Flutter module不行 Flutter Application没有啥问题 |
请问 可以根据 assets 中子文件夹 生成不同dart吗,目前的所有assets中image等都声称在一个assets.dart中 ,有些拥挤 |
如果是- assets/3.0x/arrow_right.webp这种的话有问题,生成的常量数字开头 |
建议提供如下方式的生成 // 资源文件
// assets/image/one/two/icon-one.png
// assets/image/one/two/icon-two.png
// assets/audio/hello.mp3
// 生成结果
class Assets {
Assets._();
static AssetsImage image = AssetsImage._();
static AssetsAudio audio = AssetsAudio._();
}
class AssetsImage {
AssetsImage._();
AssetsImageOne one = AssetsImageOne._();
}
class AssetsAudio {
AssetsAudio._();
String hello = 'assets/audio/hello.mp3';
}
class AssetsImageOne {
AssetsImageOne._();
AssetsImageOneTwo two = AssetsImageOneTwo._();
}
class AssetsImageOneTwo {
AssetsImageOneTwo._();
String iconOne = 'assets/image/one/two/icon-one.png';
String iconTwo = 'assets/image/one/two/icon-two.png';
}
void main() {
// 如下使用
print(Assets.image.one.two.iconOne);
print(Assets.image.one.two.iconTwo);
print(Assets.audio.hello);
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
有任何意见建议,可以在这里提,我会尽量满足
Any comments and suggestions can be made here, I will try my best to meet
The text was updated successfully, but these errors were encountered: