A VS Code extension that automates the detection and disposal of memory-leaking objects in Flutter.
Overview
Memory leaks from undisposed TextEditingControllers, AnimationControllers, and StreamSubscriptions are a common architectural pitfall in Flutter. Flutter Smart Disposer provides real-time diagnostics and automated quick-fixes to ensure your StatefulWidgets stay clean and performant.
Features
Real-time Diagnostics: Identifies undisposed variables directly within State classes.
Automated Quick Fixes: Injects dispose() methods or appends missing calls with correct indentation.
Broad Type Support: Handles controllers, focus nodes, timers, and stream subscriptions out of the box.
The engine parses the active Dart file to identify classes extending State. It tracks variable declarations of known disposable types and verifies their disposal within the class lifecycle. If a variable is instantiated but never disposed of, the extension triggers a VS Code Diagnostic warning.
Development Setup
If you want to build or contribute to the extension:
Clone the repository.
Run npm install to fetch dependencies.
Press F5 in VS Code to launch the extension in a Debug Host.
Run npm run compile to build the TypeScript source.
Contributing
Contributions are welcome. Please ensure that new features include relevant tests and follow the existing architecture patterns.