Question
vincentngo opened this issue · comments
Sorry in advance if this is not the place to ask questions.
I was just looking at your Router code to learn more about how you do things with navigator 2.0.
class TabbedRouterController extends RouterController<NavState1> {
TabbedRouterController(NavState1 state) : super(state);
void showTopPage(String value) => state = state.copyWith(topPage: value);
void changeTab(int value) => state = state.copyWith(selectedTab: value);
@override
List<Page> buildPages() {
return [
// The main view that handles switching tabs based on the .selectedTab (using Provider to bind)
_AppPage("main", ExampleTabScaffold()),
// Add full screen page on top of our main tab view?
if (state.topPage == NavState1.settingsPageLink) ...[
_AppPage(NavState1.settingsPageLink, FullScreenView("SETTINGS")),
] else if (state.topPage == NavState1.profilePageLink) ...[
_AppPage(NavState1.profilePageLink, FullScreenView("SIGNUP")),
]
];
}
I was just wondering, if the only way to present a full screen view is within the top level navigator?
E.g. if i had a nested navigator, and wanted that nested navigator to present a full screen view it wouldn't work right?
This is more a question for stackoverflow, but the quick answer is yes yo could do this. A Navigator is just a widget, you can put anywhere in the tree. You could have a Scaffold that wraps all your main routes, with a stack in it, that provides a full-screen child navigator.