Ask Your Question
2

How to keep the app bar constant while navigating through different screens using Flutter?

asked 2021-04-11 11:00:00 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-12-23 23:00:00 +0000

pufferfish gravatar image

There are several ways to keep the app bar constant while navigating through different screens using Flutter:

  1. Use a shared app bar widget: Create a separate widget for the app bar and share the widget across all screens. This will ensure the same app bar is displayed on all screens.

  2. Use a navigation drawer: If your app has a navigation drawer, you can place the app bar in the drawer so that it remains constant across all screens.

  3. Use the DefaultTabController widget: If your app has multiple tabs, you can use the DefaultTabController widget to create a constant app bar that is shared across all tabs.

  4. Use the PersistentHeader widget: This widget allows you to create a more complex layout for the app bar, and it can be made persistent across all screens.

Overall, the best approach depends on the specific needs of your app. However, with these options, you can easily keep the app bar constant while navigating through different screens using Flutter.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-04-11 11:00:00 +0000

Seen: 11 times

Last updated: Dec 23 '22