-
Notifications
You must be signed in to change notification settings - Fork 62
PREVIEW: Advanced routing
Tom Gilder edited this page Sep 5, 2021
·
1 revision
These are upcoming APIs for Routemaster v0.10 - don't try to use them yet!
But I would love any feedback on the API:
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()
.
'/stack': (_) => StackPage(
pageBuilder: (child) => BottomSheetPage(child: child),
child: StackBottomSheetContents(),
defaultPath: 'one',
),
'/stack/one': (_) => MaterialPage(child: StackPageOne()),
'/stack/one/two': (_) => MaterialPage(child: StackPageTwo()),