title: mediaquery.of() called with a context that does not contain a media query.No media query could be found starting from the context
body: <p>Hi I could not resolve this error  Exception has occurred. FlutterError (MediaQuery.of() called with a context that does not contain a MediaQuery. No MediaQuery ancestor could be found starting from the context that was passed to MediaQuery.of(). This can happen because you do not have a Widgets App or Material App widget (those widgets introduce a MediaQuery), or it can happen if the context you use comes from a widget above those widgets. The context used was: Scaffold)</p>
  <p>Here is the code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Future&lt;void&gt; main() async{
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();
    runApp(HomePage());
  }
  class HomePage extends StatelessWidget {
    final TextEditingController emailController = TextEditingController();
    final TextEditingController passwordController = TextEditingController();
  
    gotoSecondActivity(BuildContext context){
      Navigator.push(
        context,
        MaterialPageRoute(builder: (context) =&gt; SecondActivity()),
      );
    }
    @override
    Widget build(BuildContext context) {
      return MultiProvider(
        providers: [
          Provider&lt;AuthenticationService&gt;(
            create: (_) =&gt; AuthenticationService(FirebaseAuth.instance),
          ),
          StreamProvider(
            create: (context) =&gt; context.read&lt;AuthenticationService&gt;().authStateChanges,
          )
        ],
        child:Scaffold(
          backgroundColor: Colors.white,
          body: SingleChildScrollView(
            child: RaisedButton(
              onPressed: () {
                context.read&lt;AuthenticationService&gt;().signIn(
                  email: emailController.text.trim(),
                  password: passwordController.text.trim(),
                );
                gotoSecondActivity(context);
              },
              child: Container(
                child: Column(
                  children: &lt;Widget&gt;[
                    Container(
                      height: 400,
                      decoration: BoxDecoration(
                          image: DecorationImage(
                              image: AssetImage('assets/images/loginHeader.png'),
                              fit: BoxFit.fill
                          )
                      ),
                      child: Stack(
                        children: &lt;Widget&gt;[
                        ],
                      ),
                    ),
                    Padding(
                      padding: EdgeInsets.all(30.0),
                      child: Column(
                        children: &lt;Widget&gt;[
                          FadeAnimation(1.8, Container(
                            padding: EdgeInsets.all(5),
                            decoration: BoxDecoration(
                                color: Colors.white,
                                borderRadius: BorderRadius.circular(10),
                                boxShadow: [
                                  BoxShadow(
                                      color: Color.fromRGBO(143, 148, 251, .2),
                                      blurRadius: 20.0,
                                      offset: Offset(0, 10)
                                  )
                                ]
                            ),
                            child: Column(
                              children: &lt;Widget&gt;[
                                Container(
                                  padding: EdgeInsets.all(8.0),
                                  decoration: BoxDecoration(
                                      border: Border(bottom: BorderSide(
                                          color: Colors.grey[100]))
                                  ),
                                  child: TextField(
                                    controller:emailController,
                                    decoration: InputDecoration(
                                        border: InputBorder.none,
                                        hintText: "Email or Phone number",
                                        hintStyle: TextStyle(
                                            color: Colors.grey[400])
                                    ),
                                  ),
                                ),
                                Container(
                                  padding: EdgeInsets.all(8.0),
                                  child: TextField(
                                    controller: passwordController,
                                    obscureText: true,
                                    decoration: InputDecoration(
                                        border: InputBorder.none,
                                        hintText: "Password",
                                        hintStyle: TextStyle(
                                            color: Colors.grey[400])
                                    ),
                                  ),
                                )
                              ],
                            ),
                          )),
                          SizedBox(height: 30,),
                          FadeAnimation(2, Container(
                            height: 50,
                            decoration: BoxDecoration(
                                borderRadius: BorderRadius.circular(10),
                                gradient: LinearGradient(
                                    colors: [
                                      Color.fromRGBO(214, 0, 27, 1),
                                      Color.fromRGBO(214, 0, 27, 1),
                                    ]
                                )
                            ),
                            child: Center(
                              child: Text("Login", style: TextStyle(
                                  color: Colors.white,
                                  fontWeight: FontWeight.bold),),
                            ),
                          )),
                          SizedBox(height: 70,),
                          FadeAnimation(1.5, Text("Forgot Password?",
                            style: TextStyle(
                                color: Color.fromRGBO(214, 0, 27, 1)),)),
                        ],
                      ),
                    )
                  ],
                ),
              ),
            ),
          ),
        ),
      );
    }
  }</code></pre>
  </div>
  </div>
  </p>