title: Flutter: How to Recreate a Tab Bar
body: <p>I have an application that has different layouts depending on user roles, users can switch between roles from settings. The app's basic layout has a tab bar, and the tab view content changes based on the tab selected. When changing the user role, I want to go to a new layout with a new tab bar having its own tab items.
  The problem is, when I push a new page from UserRole1 layout as below:</p>
  <pre><code>Navigator.pushReplacement(
       context,
       CupertinoPageRoute(builder: (context) =&gt; UserRole2Layout()),
  );
  </code></pre>
  <p>the tab bar for UserRole1 layout still exists and the new layout with new tab bar is placed above it.</p>
  <p>How can I replace the current tab bar or go to a new layout with a new tab bar?</p>