Skip to content

Question #25

@vincentngo

Description

@vincentngo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions