Skip to content

PREVIEW: Advanced routing

Tom Gilder edited this page Sep 5, 2021 · 1 revision

PREVIEW: not released yet!

These are upcoming APIs for Routemaster v0.10 - don't try to use them yet!

But I would love any feedback on the API:

Flows

FlowPage can be used to create wizard-style interfaces which always show all steps in order.

Here's a route map for a sign-up flow with three steps:

'/sign-up': (_) => FlowPage(
      child: SignUpPage(),
      paths: ['one', 'two', 'three'],
    ),

'/sign-up/one': (_) => MaterialPage(child: SignUpPageOne()),
'/sign-up/two': (_) => MaterialPage(child: SignUpPageTwo()),
'/sign-up/three': (_) => MaterialPage(child: SignUpPageThree()),

To advance to the next page, call FlowPage.of(context).pushNext().

To go back a step, call FlowPage.of(context).pop().

Stacks

'/stack': (_) => StackPage(
      pageBuilder: (child) => BottomSheetPage(child: child),
      child: StackBottomSheetContents(),
      defaultPath: 'one',
    ),
'/stack/one': (_) => MaterialPage(child: StackPageOne()),
'/stack/one/two': (_) => MaterialPage(child: StackPageTwo()),

Child route maps

Relative route maps

Private routes

Clone this wiki locally