title: The following assertion was thrown while handling a gesture: Scaffold.of() called with a context that does not contain a Scaffold
body: <pre class="lang-dart prettyprint-override"><code>import 'package:flutter/material.dart';
  
  import 'dashboard.dart';
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: SafeArea(
          child: Scaffold(
            appBar: AppBar(
              leading: IconButton(
                icon: Icon(Icons.accessible),
                onPressed: () =&gt; Scaffold.of(context).openEndDrawer(),
              ),
              title: Text('Sorted.'),
              backgroundColor: Color(0xff0A3D62),
            ),
            drawer: Drawer(
              child: ListView(
                padding: EdgeInsets.zero,
                children: &lt;Widget&gt;[
                  new UserAccountsDrawerHeader(
                    accountName: new Text('XYZ'),
                    accountEmail: new Text('XYZ@gmail.com'),
                    currentAccountPicture: new CircleAvatar(),
                  )
                ],
              ),
            ),
            body: Center(child: Home()),
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>Error:</p>
  <pre><code>The following assertion was thrown while handling a gesture:
  Scaffold.of() called with a context that does not contain a Scaffold.
  
  No Scaffold ancestor could be found starting from the context that was passed to Scaffold.of(). This usually happens when the context provided is from the same StatefulWidget as that whose build function actually creates the Scaffold widget being sought.
  </code></pre>
  <p>The error fires when I try to open the drawer from the icon. Please help me resolve this. Thanks in advance!</p>