If you use GetX and your controller instantiated with Get.put() or Get.put() not with fenix:true or permanent:true, That controller instance should be auto disposed.
The default behavior is that you if you instantiate your controller Get.put(), it must be auto disposed.
Learn the advanced usage of GetX here
But there might be situations or bug that your controller is not auto disposed. What to do in that case?
Well, in that case, you must make your view a StatefulWidget class. That means you must convert your StatelessWidget to StatefulWidget. And then you may instantiate the controller initState() method.
See our stateful class. We have extended StatefulWidget and now we have access to initState() method.
And initState() we have instantiated the controller. Because we have used StatefulWidget, now we can access dispose() method.
With this we have complete control on the lifecycle of the the app screen DetailPage.
Now because of this, our DetailController would be always disposed.
The above problem happens when you compile your code on Windows machine. But if you compile your code on Mac or Linux machine, you will see that your controller is disposed automatically.