title: What is the right way to navigate using a drawer and change only the content of the body?
body: <p>I'm creating a basic Material App and i have a drawer for navigation.
  With the simple way of pushing a route the whole widget is getting replaced and it's like opening a whole new page that includes a whole new drawer.
  My goal is to create the atmosphere of a page and a drawer, and when the user taps a drawer item the drawer will collapse and <strong>only</strong> the content of the page will be replaced.</p>
  
  <p>I have found these two Questions/Answers:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/43680902/replace-initial-route-in-materialapp-without-animation">Replace initial Route in MaterialApp without animation?
  </a></li>
  <li><a href="https://stackoverflow.com/questions/47953410/flutter-drawer-widget-change-scaffold-body-content?rq=1">Flutter Drawer Widget - change Scaffold.body content
  </a> </li>
  </ol>
  
  <p>And my question is what is the best/correct way to achieve what i'm trying to do?</p>
  
  <p>The 1st method is just creating the illusion by removing the <code>push</code>/<code>pop</code> animation, although it still actually behaves like the original method i described.
  The 2nd method actually replaces the content only, and the solution i thought of is instead of changing the text to create multiple <code>Container</code> widgets and changing between them.</p>
  
  <p>Since i'm still new and learning flutter i would like to know what is the right practice to do so.</p>
  
  <p><strong>EDIT:</strong>
  I created <a href="https://gist.github.com/argamanza/e3adf00ded2226374917fac1ccaddd25" rel="nofollow noreferrer">this</a> and it works pretty well. I still don't know about how effective/efficient it is but for now that's exactly what i wanted to achieve:</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(new MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        title: 'Flutter Demo',
        theme: new ThemeData(
          primarySwatch: Colors.blueGrey,
        ),
        home: new TestPage(),
      );
    }
  }
  
  class TestPage extends StatefulWidget {
    @override
    _TestPageState createState() =&gt; new _TestPageState();
  }
  
  class _TestPageState extends State&lt;TestPage&gt; {
    static final Container info = new Container(
      child: new Center(
          child: new Text('Info')
      ),
    );
  
    static final Container save = new Container(
      child: new Center(
          child: new Text('Save')
      ),
    );
  
    static final Container settings = new Container(
      child: new Center(
          child: new Text('Settings')
      ),
    );
  
    Container activeContainer = info;
  
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
          drawer: new Drawer(
            child: new ListView(
              children: &lt;Widget&gt;[
                new Container(child: new DrawerHeader(child: new Container())),
                new Container (
                  child: new Column(
                      children: &lt;Widget&gt;[
                        new ListTile(leading: new Icon(Icons.info), title: new Text('Info'),
                            onTap:(){
                              setState((){
                                activeContainer = info;
                              });
                              Navigator.of(context).pop();
                            }
                        ),
                        new ListTile(leading: new Icon(Icons.save), title: new Text('Save'),
                            onTap:(){
                              setState((){
                                activeContainer = save;
                              });
                              Navigator.of(context).pop();
                            }
                        ),
                        new ListTile(leading: new Icon(Icons.settings), title: new Text('Settings'),
                            onTap:(){
                              setState((){
                                activeContainer = settings;
                              });
                              Navigator.of(context).pop();
                            }
                        ),
  
                      ]
                  ),
                )
              ],
            ),
          ),
          appBar: new AppBar(title: new Text("Test Page"),),
          body: activeContainer,
          );
    }
  }
  </code></pre>