Flutter Enhanced Actions
Enhanced widget removal for Flutter development in VS Code and Cursor IDE.
Features
This extension provides a single, powerful action designed specifically for Flutter widget removal:
- Intelligent Widget Removal - Removes both simple widgets and Builder widgets while preserving their inner content
- Perfect for MultiBlocProvider - Automatically unwraps Builder widgets that wrap complex widgets like MultiBlocProvider
- Smart Detection - Automatically detects whether you're working with a simple widget or Builder widget
- Content Preservation - Extracts and preserves the inner content when removing Builder widgets
How to Use
- Open any Dart file in VS Code or Cursor
- Click on any widget or select some code
- Look for the lightbulb icon (💡) or press
Ctrl+.
(or Cmd+.
on Mac)
- Choose "Remove Widget (Enhanced)" from the available actions
Examples
Before:
return ScreenUtilsInit(
child: Builder(builder: (context) {
return MultiBlocProvider(
providers: [
BlocProvider(create: (context) => di.sl<AuthBloc>()),
// ... more providers
],
child: MaterialApp.router(
// ... app configuration
),
);
}),
);
After using "Remove Widget (Enhanced)":
return ScreenUtilsInit(
child: MultiBlocProvider(
providers: [
BlocProvider(create: (context) => di.sl<AuthBloc>()),
// ... more providers
],
child: MaterialApp.router(
// ... app configuration
),
),
);
Before:
return Column(
children: [
Text('Hello'),
Container(
child: Text('World'),
),
],
);
After using "Remove Widget (Enhanced)" on Container:
return Column(
children: [
Text('Hello'),
Text('World'),
],
);
Installation
Development Mode (Testing)
cd flutter-enhanced-actions
code .
# Press F5 to run in Extension Development Host
Local Installation
# Package the extension
vsce package
# Install the .vsix file
code --install-extension flutter-enhanced-actions-0.1.0.vsix
Requirements
- VS Code 1.104.0 or higher
- Dart/Flutter extension installed
- Works with Cursor IDE (VS Code compatible)
Known Issues
- Widget boundary detection may need manual selection for complex nested widgets
- Some edge cases with very complex widget trees may require manual intervention
Release Notes
0.1.0
Simplified and enhanced widget removal functionality:
- SIMPLIFIED: Single "Remove Widget (Enhanced)" action that handles both simple and Builder widgets
- INTELLIGENT: Automatically detects widget type and applies appropriate removal logic
- ENHANCED: Builder widget removal that preserves inner content (perfect for MultiBlocProvider)
- IMPROVED: Better widget detection patterns and boundary detection
- CLEAN: Removed unnecessary features to focus on core functionality
0.0.1
Initial release with multiple Flutter code actions (deprecated in favor of simplified approach)
Enjoy enhanced Flutter development! 🚀