title: How to change Scaffold body based on which navigation bar button is clicked in flutter?
body: <p>i'm new to flutter and i want to make this the proper way , the thing is i have a bottom navigation bar package i <a href="https://pub.dev/packages/curved_navigation_bar" rel="nofollow noreferrer">Curved_navigation_bar</a> it has awesome looking and animation,  this navigation bar should change the body of the Scaffold widget and reveal each time a new  widget depending on the button clicked , what i'm trying to achieve is each time a button of the navigation bar is clicked do the following :</p>
  <ul>
  <li>clear the body of the <code>Scaffold</code></li>
  <li>load the related widget</li>
  </ul>
  <p>i hope this is the right approach to follow in flutter for navigation (changing the screen or the view) , if this is wrong please tell me</p>
  <pre><code>    class _SituationState extends State&lt;ScreenSituation&gt;{
           int _page = 0;
           GlobalKey _bottomNavigationKey = GlobalKey();
           @override
      Widget build(BuildContext context) {
      return Scaffold(
        body: Container(
          //if list button is clicked preveiw widget_client
          //if people button is clicked preveiw widget_people
          //if launch button is clicked preveiw launch
        ),
        bottomNavigationBar: CurvedNavigationBar(
          key: _bottomNavigationKey,
          index: 0,
          height: 75.0,
          items: &lt;Widget&gt;[
            Icon(Icons.list, size: 30),
            Icon(Icons.people, size: 30),
            Icon(Icons.launch, size: 30),
          ],
          color: Colors.white,
          buttonBackgroundColor: Colors.white,
          backgroundColor: Colors.blueAccent,
          animationCurve: Curves.easeInOut,
          animationDuration: Duration(milliseconds: 300),
          onTap: (index) {
            setState(() {
              _page = index;
            });
          },
        ),
      );
    }
  }
  </code></pre>