https://github.com/7wilightxdev/generate-assets-for-dart
It helps generate Dart constants for asset paths from a folder structure, making it easier to manage assets in Flutter projects.
https://github.com/7wilightxdev/generate-assets-for-dart
dart flutter generator vscode-extension
Last synced: 2 months ago
JSON representation
It helps generate Dart constants for asset paths from a folder structure, making it easier to manage assets in Flutter projects.
- Host: GitHub
- URL: https://github.com/7wilightxdev/generate-assets-for-dart
- Owner: 7wilightxdev
- License: mit
- Created: 2024-11-29T07:16:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-29T07:17:14.000Z (over 1 year ago)
- Last Synced: 2025-06-10T11:41:49.450Z (about 1 year ago)
- Topics: dart, flutter, generator, vscode-extension
- Language: TypeScript
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Generate Assets - VS Code Extension
Generate Assets is a Visual Studio Code extension designed for **Flutter developers**. It helps generate Dart constants for asset paths from a folder structure, making it easier to manage assets in Flutter projects.
## Features
- **Generate Asset Constants**: Automatically scans your `assets` folder and creates a Dart class with constants for all asset files.
- **Excludes Folders**: Skip specified subfolders in the configuration.
- **Customizable Output**:
- Define the output file path.
- Specify the class name.
## Getting Started
### Installation
1. Install the extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/).
2. Add a configuration file named `generate_assets_config.yaml` in your workspace.
### Configuration
Create a `generate_assets_config.yaml` file with the following format:
```yaml
assets_folder: assets # Path to the folder containing assets.
output_file: lib/app_drawables.dart # Path to the output Dart file.
excluded_folders: # Subfolders to exclude from scanning.
- temp
output_class_name: AppDrawables # Name of the Dart class.
```
### Usage
1. Open the command palette (Ctrl+Shift+P / Cmd+Shift+P).
2. Run the command Generate Assets.
3. The Dart class with constants will be generated at the specified path.