Giter Site home page Giter Site logo

auto_assets_vscode_extension's Introduction

1. 解决的问题

  1. 自动生成 pubspec.yaml 资源声明。

  2. 自动压缩资源(目前支持: jpg/jpeg/png/svg)。

  3. 自动资源类型化,类似于的 Android 的 R.java,例如:

    class Assets {
       Assets._();
       static const String commonIconClose = "assets/common/icon_close.png";
    }
    
    class AssetImages {
       AssetImages._();
       static AssetImage get commonIconClose => const AssetImage(Assets.commonIconClose);
    }

2. 工具使用

2.1. 项目配置

在项目根目录下新建 assets_config.json 文件,文件内容:

{
  "assets": "assets/",
  "code": "lib/assets/"
}
  • assets 代表项目中资源文件的根目录,有多个的时候可以传入数组。
  • code 代表自动生成的代码的根目录

2.2. VSCode 插件

  1. 在 VSCode -> Extensions 下搜索 auto_assets 并安装。
  2. 重新打开项目。

auto_assets_vscode_extension's People

Contributors

raomengyun avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.