Lightweight extension that speeds up the development of Dart projects by running build_runner commands for the current package with @freezed, @riverpod, or @RoutePage annotations.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
To use this extension locally without publishing it:
Install Node.js
Create a Project Folder: Create a new folder on your computer for the extension (e.g., vscode-dart-build-runner).
Add Files: Place the extension.js and package.json files from above into this new folder.
Install Dependencies:
Open a terminal or command prompt
Navigate into your new folder (cd vscode-dart-build-runner)
Run the command npm install. This will create a node_modules folder with the necessary dependencies.
Run in VS Code:
Open the vscode-dart-build-runner folder in VS Code (code .)
Press F5 on your keyboard. This will compile the extension and launch a new "Extension Development Host" window.
Test the Extension:
In the new window (the "Extension Development Host"), open any of your Dart or Flutter projects that use code generation
Open a file that contains code generation annotations (like @freezed, @riverpod, @RoutePage, etc.)
Right-click in the editor or use the Command Palette to find and run the "Build Runner: Run in current package" command. A terminal should appear and run the build command.