Reputation: 63
UPDATE: I have a general idea of what dispose does. But I want a list of specific items have to be disposed, like: text controllers, stream controllers, or "any and all variables declared in a Stateful page"...
Here is the original post:
...
I know you use Dispose to "clean up" a Stateful page. And I have used it for textfield controllers. But I am unclear on:
Thanks!
Upvotes: 2
Views: 435
Reputation: 1242
dispose
method is used to release the memory allocated to variables when the state object is removed.
For example, if you are using a stream
in your application then you have to release memory allocated to the stream controller
. Otherwise, your app may get a warning from the PlayStore and AppStore about memory leakage.
Upvotes: 0