Reference
Example App Walkthrough
How the bundled example app is organised, in the order worth reading it.
The example/ app is the integration template: everything from the tutorial, at full size. On the
live demo
the top bar pins phone / foldable / tablet / desktop widths, so you can see every breakpoint without resizing the window.
Run it
cd example
flutter run -d chrome
flutter test
Reading order
-
lib/main.dartβMaterialApp.router(routerConfig: RouterPages.router)plus the width-preset wrapper (pages/size_preset_screen.dart). -
lib/router/router_names.dartβ every path and route name as a constant. -
lib/router/router_pages.dartβ the complete route table: top-levelredirect, auth routes outside the shell, theAdaptiveShellRoutewith its custom handle, breadcrumbs and card panes, and the branches. -
lib/shell/app_shell.dartβAdaptiveShellChrome+NavigationBarvsNavigationRail, re-tapping a tab, andPopScopeexit confirmation. -
lib/pages/β¦β the screens, one folder per area (table below).lib/services/holds the signals they share.
Areas
| Area | What it shows | Tutorial step | Files |
|---|---|---|---|
| Auth |
Full-screen splash / login / register;
redirect
to
/login?from=
for the account page
|
Redirects | pages/auth/ |
| Home |
Product list β
/home/:id
with a
title
from the id; translucent full-screen image preview via
transitionsBuilder
|
Nested routes, Customizing | pages/home/ |
| Shopping cart | A separate branch with its own stack | Tabs | pages/shopping_cart/ |
| Contacts |
List β
/contacts/:id
β
edit
;
onExit
dialog with
useRootNavigator
chosen via
AdaptivePaneScope
|
onExit | pages/contacts/ |
| Mine |
Nested
theme
/
account
pages;
about
as a
fullscreenDialog
|
Customizing | pages/mine/ |
| Shell |
Bar vs rail,
goBranch(i, initialLocation: true)
,
PopScope
exit confirmation
|
Tabs | shell/app_shell.dart |
Things to try in the demo
- Desktop preset β Contacts β a contact β edit: three levels, two columns, breadcrumbs.
- Type in the remark, press Escape: the
onExitdialog. - Mine β account while signed out: redirected to login, then returned.
- Switch between the phone and desktop presets with a detail page open.