Flutter Web resize browser-window leads to a defunct context

704 views Asked by At

I made a web-app with flutter and there are bar-charts. I want to refresh them if the screen size changes. This works fine if I switch between the browser window option "shrink" and "enlarge". But if I use the arrows to manually change th size of the window I get this error:

"The widget has been unmounted, so the State no longer has a context..."

Does anyone knows why this appears?

1

There are 1 answers

0
Delwinn On

Use flexible as child of scaffold. Or Container() with height and width = MediaQuery.of(context).size.height and ...width respectively.