MediaQuery.of () chamado com um contexto que não contém um MediaQuery.
You need a MaterialApp or a WidgetsApp around your widget. They provide the MediaQuery. When you call .of(context) flutter will always look up the widget tree to find the widget.
Real Rabbit