Keyboard Shortcuts

j / kScroll down / up
ggScroll to top
GScroll to bottom
/Open search
?Show this help
EscClose search / help
n / NNext / previous section
hGo to landing
dGo to docs
:Command mode — type section name

Press ? or Esc to close

Architecture

Routing

Feature defines its own route. App collects all routes. Navigate via enum — never hardcoded strings.

Feature defines its route

// features/profile/config/profile_route.dart
final profileRoute = GoRoute(
  path: '/profile',
  onEnter: (context, state) => registerProfileDependencies(),
  onExit:  (context, state) => unregisterProfileDependencies(),
  builder: (context, state) => const ProfileScreen(),
);

App collects all feature routes

// app/app_router.dart
final appRouter = GoRouter(
  routes: [
    profileRoute,
    homeRoute,
    settingsRoute,
    // each feature plugs in here
  ],
);

Navigate — always via AppRoutes enum

// Never hardcoded strings — always enum
context.go(AppRoutes.profile.path);
context.push(AppRoutes.settings.path);
sam's arch — A Pragmatic Flutter Architecture