title: How to hide navigation bar after moving to another page (flutter)?
body: <p>In the homepage i am calling widget to my body main.dart base on navigation bar option, in the homepage it has a list of images, if i click one of the images, it shows me the detail. the problem is the navigation bar in the detail page still show. How to hide the navigation bar?</p>
  
  <p>Main.dart</p>
  
  <pre><code>class MyApp extends StatefulWidget {
    @override
    _NavState createState() =&gt; _NavState();
  }
  
  class _NavState extends State {
    int _selectedIndex = 0;
  
    final _widgetOptions = [
      Breakfast(),
      Desert(),
    ];
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: _widgetOptions.elementAt(_selectedIndex),
        bottomNavigationBar: Container(
          color: Colors.grey[100],
          child: DefaultTabController(
            length: 2,
            child: TabBar(
              indicatorColor: Colors.grey,
              labelColor: Colors.blueAccent,
              unselectedLabelColor: Colors.grey,
              onTap: _onItemTapped,
              tabs: [
                Tab(
                  text: 'Breakfast',
                ),
                Tab(
                  text: 'Dessert',
                ),
              ],
            ),
          ),
        ),
      );
    }
  
    void _onItemTapped(int index) {
      setState(() {
        _selectedIndex = index;
      });
    }
  }
  
  </code></pre>
  
  <p>One of widget that i call to my homepage</p>
  
  <pre><code>class Breakfast extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      final title = "Fatoni's Resto Menu";
      return MaterialApp(
        title: title,
        home: Scaffold(
          appBar: AppBar(
            title: Text(title),
            actions: &lt;Widget&gt;[
              IconButton(
                icon: Icon(Icons.settings),
                onPressed: () {},
              )
            ],
          ),
          body: GridView.builder(
            itemCount: DataBreakfast.listViewData.length,
            gridDelegate:
                SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
            itemBuilder: (context, index) {
              return Column(
                children: &lt;Widget&gt;[
                  Expanded(
                    child: Card(
                      margin: EdgeInsets.all(10.0),
                      child: InkWell(
                        onTap: () {
                          Navigator.push(
                            context,
                            MaterialPageRoute(
                              builder: (context) {
                                return DetailScreen(
                                    name: DataBreakfast.listViewData[index],
                                    image: DataBreakfast.listViewDataImage[index],
                                    info: DataBreakfast.listViewDataInfo[index],
                                    index: index);
                              },
                            ),
                          );
                        },
                      ),
                    ),
                  )
                ],
              );
            },
          ),
        ),
      );
    }
  }
  
  </code></pre>