title: FlutterError (No MediaQuery widget ancestor found. I had used the MaterialApp, but still got error
body: <p>Where has problems in my main.dart? I had used the MaterialApp, but still got error <code>FlutterError (No MediaQuery widget ancestor found.</code></p>
  <p>Do I miss something? But if I remove the <code>MaterialApp</code>, still got error</p>
  <pre><code>void main() async {
    runApp(const MyApp());
  }
  
  class MyApp extends StatelessWidget {
    const MyApp({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: Scaffold(
          body: Container(
            decoration: BoxDecoration(
              image: DecorationImage(
                  image: AssetImage('assets/images/my_bg.png'),
                  fit: BoxFit.cover),
            ),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.end,
              children: [
                Container(
                  padding: const EdgeInsets.all(16),
                  width: MediaQuery.of(context).size.width,
                  child: AuthGate(),
                )
              ],
            ),
          ),
        ),
      );
    }
  </code></pre>