A powerful Chrome extension that makes copying Flutter widgets with proper bracket matching effortless. No more counting brackets manually!
- 🎯 Smart Widget Detection: Automatically identifies Flutter widget structures
- 🔗 Perfect Bracket Matching: Handles nested parentheses, curly braces, and square brackets
- ⌨️ Keyboard Shortcuts: Quick access with
Ctrl+Shift+C(orCmd+Shift+Con Mac) - 🎨 Beautiful UI: Modern, intuitive popup interface
- 📊 Usage Statistics: Track how many widgets you've caught
- 🛡️ Error Handling: Robust error handling with helpful notifications
- 🚀 Performance Optimized: Lightweight and fast
- 🔧 Testing Built-in: Test extension functionality directly from popup
- Visit the Chrome Web Store
- Click "Add to Chrome"
- Confirm the installation
- Clone this repository
- Run
npm installto install dependencies - Run
npm run buildto build the extension - Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
distfolder
- Navigate to any webpage with Flutter widget code
- Select the widget name (e.g., "Container", "Column", "Row")
- Right-click and select "🎯 Catch Flutter Widget"
- The complete widget with proper brackets will be copied to your clipboard!
- Select any Flutter widget text
- Press
Ctrl+Shift+C(Windows/Linux) orCmd+Shift+C(Mac) - Widget automatically copied with perfect bracket matching!
// Before: You select just "Container"
Container(
padding: EdgeInsets.all(16.0),
child: Column(
children: [
Text('Hello'),
Button(
onPressed: () => print('Clicked'),
child: Text('Click me'),
),
],
),
)
// After: Complete widget copied to clipboard with all brackets matched!- Node.js 14+ and npm 6+
- Chrome browser for testing
# Clone the repository
git clone https://github.com/your-username/flutter-widget-catcher.git
cd flutter-widget-catcher
# Install dependencies
npm install
# Start development with hot reload
npm run watch
# Build for production
npm run build
# Run tests
npm test
# Run linting
npm run lint
# Create extension package
npm run packageflutter-widget-catcher/
├── src/ # Source code
│ ├── background.js # Background script (service worker)
│ ├── contentScript.js # Content script (injected into pages)
│ ├── popup.js # Popup interface logic
│ ├── popup.css # Popup styles
│ └── snackbar.css # Notification styles
├── public/ # Static assets
│ ├── manifest.json # Extension manifest
│ ├── popup.html # Popup HTML
│ └── icons/ # Extension icons
├── config/ # Build configuration
│ ├── webpack.config.js # Webpack config
│ └── webpack.common.js # Common webpack settings
├── scripts/ # Build and deployment scripts
│ ├── package.js # Extension packaging
│ └── upload-to-store.js # Chrome Web Store upload
├── tests/ # Test files
│ ├── chrome-mock.js # Chrome API mocks
│ └── setup.js # Test setup
└── .github/workflows/ # CI/CD workflows
└── ci-cd.yml # GitHub Actions
This project features a comprehensive CI/CD pipeline that automatically:
- Multi-Node Testing: Tests on Node.js 16.x, 18.x, and 20.x
- Code Quality: ESLint for code standards
- Security Scanning: npm audit and Snyk vulnerability checks
- Test Coverage: Jest with coverage reporting
- Build Validation: Ensures extension builds successfully
- Trigger: Push to
developbranch - Action: Deploys to development Chrome Web Store (unpublished)
- Testing: Safe environment for testing new features
- Trigger: Git tags (e.g.,
v1.0.0) - Action: Deploys to production Chrome Web Store with auto-publishing
- Release: Creates GitHub release with changelog
- Builds optimized extension bundle
- Creates downloadable ZIP package
- Validates manifest.json structure
- Uploads build artifacts
To enable automatic deployment to Chrome Web Store:
- Go to Google Cloud Console
- Create or select a project
- Enable the Chrome Web Store API
- Create OAuth 2.0 credentials (Desktop application type)
- Note down your
Client IDandClient Secret
# Use the upload script helper
node scripts/upload-to-store.js --token-helpAdd these secrets to your GitHub repository:
# Required for all deployments
CHROME_CLIENT_ID=your_oauth_client_id
CHROME_CLIENT_SECRET=your_oauth_client_secret
CHROME_REFRESH_TOKEN=your_refresh_token
# Development environment
CHROME_EXTENSION_ID_DEV=your_dev_extension_id
# Production environment
CHROME_EXTENSION_ID_PROD=your_prod_extension_id
# Optional: Notifications
SLACK_WEBHOOK_URL=your_slack_webhook
DISCORD_WEBHOOK_URL=your_discord_webhook
SNYK_TOKEN=your_snyk_tokengit checkout develop
git add .
git commit -m "feat: new feature"
git push origin develop
# Automatically deploys to dev environment# Create and push a version tag
npm run version:patch # or version:minor, version:major
# Automatically deploys to production and creates GitHub release# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm test -- --coverage- Unit Tests: Test individual functions and components
- Integration Tests: Test Chrome extension APIs
- Mocking: Chrome APIs are mocked for reliable testing
// Example test
describe('Widget Catcher', () => {
test('should extract widget name correctly', () => {
const result = extractWidgetName('Container(child: Text("Hello"))');
expect(result).toBe('Container');
});
});| Script | Description |
|---|---|
npm run watch |
Development mode with hot reload |
npm run build |
Production build |
npm run build:dev |
Development build |
npm run clean |
Clean dist and build folders |
npm run lint |
Check code style |
npm run lint:fix |
Fix code style issues |
npm test |
Run tests |
npm run package |
Create extension ZIP package |
npm run release |
Build, package, and upload to store |
npm run version:patch |
Bump patch version and tag |
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Run the linter:
npm run lint:fix - Run tests:
npm test - Commit changes:
git commit -m 'feat: add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
We use Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation updatesstyle:- Code style changesrefactor:- Code refactoringtest:- Test additions/updateschore:- Maintenance tasks
- Bug Reports: Create an issue
- Feature Requests: Create an issue
- Support: Discussions
- Firefox Support: Extend to Firefox browser
- Edge Support: Microsoft Edge compatibility
- Smart Widget Recognition: AI-powered widget detection
- Custom Shortcuts: User-configurable keyboard shortcuts
- Widget Templates: Save and reuse common widget patterns
- Syntax Highlighting: Better visual feedback
- Multi-language Support: Internationalization
The extension includes privacy-friendly analytics:
- Usage Statistics: Number of widgets caught (stored locally)
- Error Tracking: Anonymous error reporting for improvements
- No Personal Data: We don't collect any personal information
- Local Storage Only: All data stays on your device
- No Tracking: No user behavior tracking
- Minimal Permissions: Only necessary Chrome permissions
- Open Source: Complete transparency
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who help improve this extension
- Flutter community for inspiration and feedback
- Chrome Extension documentation and examples
If you find this extension helpful, consider:
Made with ❤️ for Flutter developers
⭐ Star this repository if you find it useful!
