Search code snippets, questions, articles...

Avoid setState after dispose solution

Override setState function to avoid calling setState after dispose
@override
void setState(VoidCallback fn) {
    if(mounted) {
        super.setState(fn);
    }
}
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.

Search Index Data (The code snippet can also be found with below search text)

setState
dispose
Was this helpful?
0 Comments