Skip to content
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

Open
cr1992 opened this issue Nov 29, 2022 · 4 comments
Open

【Feedback】意见反馈 #6

cr1992 opened this issue Nov 29, 2022 · 4 comments

Comments

@cr1992
Copy link
Owner

cr1992 commented Nov 29, 2022

有任何意见建议,可以在这里提,我会尽量满足
Any comments and suggestions can be made here, I will try my best to meet

@canhuah
Copy link

canhuah commented Dec 7, 2022

This project is not the flutter project! 好像Flutter module不行 Flutter Application没有啥问题

@yjt1216
Copy link

yjt1216 commented Jul 27, 2023

请问 可以根据 assets 中子文件夹 生成不同dart吗,目前的所有assets中image等都声称在一个assets.dart中 ,有些拥挤

@ikakaxi
Copy link

ikakaxi commented Aug 28, 2023

如果是- assets/3.0x/arrow_right.webp这种的话有问题,生成的常量数字开头

@lvxiaohai
Copy link

建议提供如下方式的生成

// 资源文件
// 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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants