The Flutter assistant is a plugin for Android Studio and IntelliJ that helps developers ensure all BLoC events are in use. This tool checks for unused event classes and provides helpful suggestion to ✨automagically✨ generate the handler inside the related BLoC.
- Unused Class Detection: Automatically detects BLoC event classes that aren't used in the related BLoC and highlights them for review.
- Fix Suggestions: Provides actionable suggestions for handling unused events.
- Code Quality Insights: Helps maintain clean code by flagging unnecessary classes, improving code readability and reducing project clutter.
- Android Studio: This plugin is compatible with Android Studio and IntelliJ versions supporting Flutter and Dart projects.
- Download the latest release of the Flutter assistant from the JetBrains Marketplace.
- Open Android Studio, go to File > Settings > Plugins.
- Click on the Gear icon > Install Plugin from Disk and select the downloaded
.zipor.jarfile. - Restart Android Studio to activate the plugin.
Alternatively, you can install the plugin directly from the JetBrains Marketplace:
- Go to File > Settings > Plugins.
- Search for "Flutter assistant" in the marketplace.
- Click Install and restart Android Studio.
- Analyze Dart Classes:
- Once installed, open any BLoC event file in your Flutter project.
- The plugin will automatically scan your file for unused classes.
- View Suggestions:
- For any unused events detected, the plugin displays a popup of suggested actions.
- Click on Add BLoC handler for unused event to automatically apply the recommended changes.
When an unused BLoC event class is detected, the plugin will suggest:
"Add BLoC handler for unused event."
No additional configuration is required. Once installed, the plugin runs seamlessly in the background.
Contributions are welcome! Feel free to open issues for bugs, suggestions, or improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Basel, a mobile team tech lead with expertise in Flutter and clean architecture.