title: Jetpack Compose - Navigate both with and without BottomBar
body: <p>i have a Jetpack Compose project that includes navigating using a <code>Scaffold</code> with a <code>BottomBar</code>. By the way, in specific screens, i would like to being able to navigate outside of the <code>innerPadding</code> scope of the <code>Scaffold</code> and just have the composable to be displayed in full screen.</p>
  <p>Using <a href="https://developer.android.com/jetpack/compose/navigation#bottom-nav" rel="nofollow noreferrer">official docs</a> approach is fine only until you just need to navigate clicking on the items of the <code>BottomBar</code>.</p>
  <p>I found a workaround solution in this <a href="https://stackoverflow.com/questions/70560579/navigate-to-another-screen-without-the-previous-scaffold-in-jetpack-compose">post</a> where you use this:</p>
  <pre><code>@Composable
  fun OneScreen(navController: NavHostController) {
      MainScaffold(
          bottomBar = { BottomBar(navController = navController) },
          content = {
          // content
       })
  }
  </code></pre>
  <p>for screens where <code>BottomBar</code> needs to be displayed and this:</p>
  <pre><code>@Composable
  fun AnotherScreen() {
      MainScaffold ()  {
          //content
      }
  }
  </code></pre>
  <p>for the screens where you don't need it to be diplayed.</p>
  <p>I call this a &quot;workaround solution&quot; because in this way you need to regenerate the <code>BottomBar</code> on every screen, making it flashing everytime you click on one item because of recomposition (differently from standard BottomBar navigation).</p>
  <p>I'm getting the feeling that there should be a more elegant solution, but i lack the experience to be sure of it and i have not been able to find it until now.</p>
  <p><strong>EDIT</strong>: <strong>I was WRONG on a relevant aspect</strong>. The flashing is not because of recomposition but because of the <code>Transition Animation</code> (Fade out/Fade in) provided by the <code>Navigation</code> component. Hence, it is possible to eliminate the 'flashing' issue setting No animation on transition. Of course this is still a work-around solution because it limit the user on the flexibility in animating the app.</p>