title: How to persist a BottomNavigationBar across to screens using onGenerateRoute?
body: <p>I'm trying to implement a simple BottomNavigationBar to navigate across the screens that I dynamically generate. </p>
  
  <p>Having a React.js background I thought of having some kind of wrapper around my screens that would contain the BottomNavigationBar and render screens as children according to the current route. But there's no way to append a child when defining a MaterialApp widget so that BottomNavigationBar is present and somehow wraps around the screens from onGenerateRoute. The only other way I see is to pass my BottomNavigationBar to every screen as a bottomNavigationBar property within a Scaffold. But it doesn't seem to be an optimal thing to do.</p>
  
  <p>Here's my Router:</p>
  
  <pre><code>class Router {
    static Route&lt;dynamic&gt; generateRoute(RouteSettings settings) {
      final args = settings.arguments;
  
      switch (settings.name) {
        case '/':
          return MaterialPageRoute(
            builder: (BuildContext context) =&gt; Home(),
          );
        default:
          return MaterialPageRoute(
            builder: (BuildContext context) =&gt; Error(),
          );
      }
    }
  }
  </code></pre>
  
  <p>The router I pass to the onGenerateRoute property of the MaterialApp widget:</p>
  
  <pre><code>class App extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        initialRoute: '/',
        onGenerateRoute: Router.generateRoute,
      );
    }
  }
  </code></pre>