Flutter Assets Generator
🚀 Automatically generate Flutter assets.dart file from your assets directory with proper variable naming conventions.
Features
- 🔍 Smart Asset Scanning - Automatically scans your assets directory and subdirectories
- 📝 Clean Code Generation - Generates properly formatted Dart code with camelCase variable names
- ⚙️ Configurable Settings - Customize ignored file extensions, output paths, and more
- 🎯 Context Menu Integration - Right-click on assets folder for quick generation
- 📁 Flexible Structure - Works with any asset folder structure
- 🚫 Smart Filtering - Automatically ignores font files and other unwanted extensions
Installation
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X )
- Search for "Flutter Assets Generator Pro"
- Click Install
Usage
- Right-click on your
assets folder in VS Code Explorer
- Select "Generate Assets"
- The extension will create
lib/generated/assets.dart
Method 2: Command Palette
- Open Command Palette (
Ctrl+Shift+P )
- Type "Flutter Assets: Generate Assets"
- Press Enter
Method 3: With Custom Options
- Open Command Palette (
Ctrl+Shift+P )
- Type "Flutter Assets: Generate Assets with Options"
- Configure custom paths and settings
or
Use key bindings alt+i to generate
Available Commands
Command |
Description |
Flutter Assets: Generate Assets |
Generate assets file with default settings |
Flutter Assets: Generate Assets with Options |
Generate with customconfiguration |
Configuration
Configure the extension through VS Code settings:
{
"flutterAssetsGenerator.assetsDir": "assets",
"flutterAssetsGenerator.outputFile": "lib/generated/assets.dart",
"flutterAssetsGenerator.ignoredExtensions": [".ttf", ".otf"]
}
Files being ignored?
- Check your
ignoredExtensions setting
- Font files (
.ttf , .otf ) are ignored by default
- Add custom extensions to ignore list if needed
Author
Irshad KP
irshadkp.dev@gmail.com
| |