Pub Studio is a Visual Studio Code extension designed to simplify the management of Flutter/Dart packages and plugins directly within the editor. This extension provides a seamless experience for developers, allowing them to manage dependencies, run scripts, and view package information without leaving the editor.
- Scripts Management: Easily run common Flutter and Dart scripts.
- Actions: Add, update, or remove dependencies with ease.
- Dependencies: View and manage your project's dependencies and dev dependencies.
- Integrated Pubspec Management: Navigate to dependency definitions within the
pubspec.yaml
file. - Makefile Support: Automatically detect and add Makefile targets to scripts.
- Custom Commands: Support for custom commands defined in
settings.json
.
To install Pub Studio:
- Open Visual Studio Code.
- Go to the Extensions view by clicking on the Extensions icon in the Sidebar.
- Search for
Pub Studio
. - Click on the
Install
button.
Pub Studio adds an icon to the VS Code sidebar. Clicking on this icon will open the Pub Studio panel, which includes sections for Scripts, Actions, Dependencies, and Dev Dependencies.
- Flutter Clean.
- Static Analysis.
- Dart Fix: Applies fixes with
dart fix --apply
. - Dart Format.
- Makefile Targets: Automatically detected and added from your Makefile.
- Custom Commands: Defined in your
settings.json
.
- Installs all dependencies.
- Sort all dependencies.
- Remove unused dependencies.
- Add dependency(single or multiple).
- Add Dev Dependency(single or multiple).
- View Dependencies: Displays all project dependencies. Right-click on a dependency to update or remove it.
- View Dev Dependencies: Displays all dev dependencies. Right-click on a dev dependency to update or remove it.
- Workspace-Specific Management: Manage scripts, actions, dependencies, and dev dependencies for each nested workspace individually.
- Unified View: All nested workspaces are displayed under a unified view in the Pub Studio sidebar, allowing for easy navigation and management.
Pub Studio provides several commands accessible from the command palette (Cmd+Shift+P
or Ctrl+Shift+P
):
Pub Studio: Install All Dependencies
Pub Studio: Sort All Dependencies
Pub Studio: Remove Unused Dependencies
Pub Studio: Add Dependency
Pub Studio: Add Dev Dependency
Pub Studio: Update Dependency
Pub Studio: Remove Dependency
Pub Studio now supports custom commands defined in your VS Code settings.json
. These commands will appear in the Scripts section of the Pub Studio panel, allowing you to run them directly from VS Code.
- Open your
settings.json
file in VS Code. - Add your custom commands under
pubStudio.customCommands
.
Example settings.json
:
{
"pubStudio.customCommands": {
"Run Custom Command 1": "echo Custom Command 1",
"Run Custom Command 2": "echo Custom Command 2"
}
}
Pub Studio also supports Makefile targets. It automatically detects targets in your Makefile and adds them to the Scripts section, allowing you to run them directly from Pub Studio.
Example Makefile
:
.PHONY: clean build
clean:
flutter clean
build:
flutter build apk
No additional configuration is required. Pub Studio reads from your pubspec.yaml
file to provide information about your dependencies and scripts.
Contributions are welcome! Please fork the repository and submit pull requests for any enhancements or bug fixes.
If you find Pub Studio useful, please consider starring our repository on GitHub! Your support helps us continue to improve the extension.
This extension is licensed under the MIT License.
For detailed documentation and contribution guidelines, please visit the GitHub repository.