title: No MediaQuery ancestor could be found?
body: <p>I'm trying to build a Container that is a third of size of the page but i'm getting an error <code>No MediaQuery ancestor could be found starting from the context that was passed to MediaQuery.of().</code> and I'm not sure why at all. Its in <code>MaterialApp</code>. </p>
  
  <p>My Code: </p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  
  void main() =&gt; runApp(LoginPage());
  
  class LoginPage extends StatelessWidget{
  
    @override
    Widget build(BuildContext context){
      return MaterialApp(
        home: Scaffold(
          body: Container(
            constraints: BoxConstraints.expand(),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              children: &lt;Widget&gt;[
                Container(
                  color: Colors.red,
                  width: double.infinity,
                  height: MediaQuery.of(context).size.height/3,
                )
              ],
            )
          )
        )
      );
    }
  }
  </code></pre>