dispose-getx-fields
Warns when a widget state field is not disposed in the onClose
method.
Example
❌ Bad:
class _ShinyWidgetController extends GetxController {
final _someDisposable = SomeDisposable();
final _anotherDisposable = AnotherDisposable(); // LINT
void onClose() {
_someDisposable.dispose();
super.onClose();
}
}
✅ Good:
class _ShinyWidgetController extends GetxController {
final _someDisposable = SomeDisposable();
final _anotherDisposable = AnotherDisposable();
void onClose() {
_someDisposable.dispose();
_anotherDisposable.dispose();
super.onClose();
}
}