flutter_assets 0.0.2 copy "flutter_assets: ^0.0.2" to clipboard
flutter_assets: ^0.0.2 copied to clipboard

Flutter Assets can help you quickly generate image resource code in flutter development

Features #

帮助你在flutter开发中快速生成图片资源相关代码
Help you quickly generate code related to image resources in Flutter development

Getting started #

在pubspec.yaml文件中添加如下依赖(Add this to your package's pubspec.yaml file:)

dev_dependencies:
  flutter_assets: ^0.0.1

设置图片路径 (Set image path)

[picture]

Usage #

步骤1:在test目录下创建一个test.dart文件,输入如下代码: #

Step1:in the test directory, create a test.dart file, and enter the following code:

void main() {
  test('RefreshAssets', () {
    /// projectPath: 项目路径,自动读取项目根目录
    /// imagePath: 图片资源存放路径, 默认 assets/images
    /// codePath: 代码生成路径, 默认使用 lib/app_res
    /// codeName: 代码生成文件名称,默认使用 app_image
    /// className: 生成的类名,默认使用 AppImages
    /// maxLineLength: 代码单行最大长度
    FlutterAssets.refreshImages(
      projectPath: "",
      imagePath: "assets/images",
      codePath: "lib/app_res",
      codeName: "app_image",
      className: "AppImages",
      maxLineLength: 80,
    );
  });
}

步骤2:点击test.dart文件中的运行按钮,生成图片资源代码 #

Step2:Click the run button in the test.dart file to generate the image resource code [picture]

运行成功(Run Successfully) #

[picture]

自动生成文件(Automatically generate files) #

[picture]

第一次运行成功后,在AndroidStudio顶部工具栏中可以看到RefreshAssets,以后可以直接选择该选项,一键运行 #

After the first successful run, you can see RefreshAssets in the top toolbar of AndroidStudio, and you can directly select this option for one-click operation in the future [picture]

运行成功(Run Successfully) #

[picture]

2
likes
0
points
77
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter Assets can help you quickly generate image resource code in flutter development

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_assets