zhanzengyu/FlutterNote

MediaQuery.of() called with a context that does not contain a MediaQuery

zhanzengyu opened this issue · 0 comments

what I meet the question is directly return Scaffold

return new Scaffold(
        appBar: new AppBar(
          title: new Text('demo'),
        ),
        body:Text('test')
    );

instead of return MaterialApp is solve this question.

return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('demo'),
        ),
        body:Text('test')
      ),
    );