Overview Version History Q & A Rating & Review
This VS Code extension helps you quickly extract Flutter widgets into separate Dart files, improving code organization and reusability.
Features:
Extracts widgets: Selects the widget code within the editor and extracts it into a new Dart file.
Generates file name: Creates a file name based on the widget class name (camelCase to snake_case).
Adds import: Automatically adds an import statement for the extracted widget in the original file.
Removes original code (optional): Removes the extracted widget code from the original file.
Installation:
Open the VS Code Extensions view (Ctrl+Shift+X).
Search for "Flutter Widget Extractor".
Click "Install".
Usage:
Place your cursor on the line where the widget class is defined.
Open the context menu and select "Flutter: Extract Widget to File".
Or Open the Command Palette (Ctrl+Shift+P) and type "Widget to File".
Select the "Flutter: Extract Widget to File" command.
The extension will create a new Dart file with the widget code and add an import statement to the original file.
Contributing:
Contributions are welcome! Please submit pull requests to the GitHub repository .
License:
This extension is licensed under the MIT License .
Disclaimer:
This extension is provided "as is" without any warranty. Use at your own risk.