Reputation: 11
how to make the app bar stay persistent across all the page? I tried with creating a separate file and then importing it under drawer property but its not working...is there any other way of doing it?
Upvotes: 1
Views: 1727
Reputation: 1120
from what I understand from persistent. You want that appbar to remain static when changing pages. To do that you should create and use a single scaffold for every page instead of creating a new scaffold for every page. You have to create widgets with bodies of different pages and then set those widgets to the main scaffold body using some conditions in setState. Note as you will be using setState you need to use a stateful widget.
Here is an elaborate article on how to do that with the bottom navbar.
Upvotes: 1