title: How do I access BuildContext outside of a stateful or stateless widget?
body: <p>I created a class that extends the AppBar class in Flutter so I can reuse it whenever I need it.
  My problem is how do I access the Stateful/Stateless widget build context?</p>
  
  <pre><code>class AppBarLayout extends AppBar {
  
    static final AppController _appController = new AppController();
  
    final GlobalKey&lt;ScaffoldState&gt; _scaffoldKey;
    final String appBarTitle;
  
    AppBarLayout(this.appBarTitle,this._scaffoldKey): super(
      title: Text(appBarTitle),
        leading: IconButton(
          onPressed: () =&gt; _scaffoldKey.currentState.openDrawer(),
          iconSize: 28,
          icon: Icon(Icons.menu,color: Colors.white),
        ),
        actions: &lt;Widget&gt;[
          IconButton(
            onPressed: () =&gt; _appController.signOut().then((_) {
              _appController.navigateTo(context, new GoogleSignView());
            }),
            icon: Icon(Icons.account_box),
            padding: EdgeInsets.all(0.0),
            ),
        ],
    );
  }
  </code></pre>