FlutterNote icon indicating copy to clipboard operation
FlutterNote copied to clipboard

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

Open zhanzengyu opened this issue 6 years ago • 0 comments
trafficstars

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')
      ),
    );

zhanzengyu avatar Feb 11 '19 08:02 zhanzengyu