config/routes library

Classes

Single sidebar nav destination. The full ordered list lives at navSpecs below.
ScaffoldWithNavBar
Responsive editorial shell.

Enums

Section the nav tile belongs to. Drives the small-caps section header in the sidebar and the order in which tiles appear.

Constants

desktopBreakpoint → const double
Desktop breakpoint — matches the shell's NavigationRail threshold in routes.dart.
mobileQuickAccessRoutes → const List<String>
Mobile bottom-bar quick-access subset (Today / Review / Tutor only). The full IA stays reachable from the drawer; this strip is for the thumb-frequent destinations.
Back-compat alias — older tests imported navDestinations. Surface the same data here so they keep compiling. Prefer navSpecs for new code; this list will be deleted once test references are migrated.
Canonical sidebar IA — three sections (LEARN / LIBRARY / ACCOUNT). Mirrors the design at /tmp/dutato-design/dutato-design-system/project/v2/mocks/learner-home.html. Unlike the previous flat 3-tuple list, this is sectioned and includes the new Bookmarks tile and the Tutor / Review promotions.

Properties

loadLibrary tear-offs for the seven nav-rail destinations a signed-in user is overwhelmingly likely to visit within seconds of first paint. Used by preloadNavRailLibraries to warm the deferred-chunk cache in the background after first paint, so subsequent navigation clicks are synchronous.
final
router GoRouter
The active router instance, set by createRouter. Used by static callbacks (e.g. notification tap handler) that cannot receive the instance directly.
no setter

Functions

authRedirect(Session? session, GoRouterState state, {String? lastMode, List<String>? adminOrgIds, String? lastActiveOrgId}) String?
Determines the redirect path based on authentication state, MFA level, and (optionally) the user's last-used mode.
createRouter({required bool supabaseReady, VoidCallback? onSetupComplete}) GoRouter
Creates the app router. When supabaseReady is false, all routes redirect to /setup and the auth listener is not attached.
orgDetailRouteTitle(String location, String orgId) String
Maps an /org/:orgId/<sub> path to the AppBar title used by OrgDetailScaffold. Centralised here so adding a new detail route only needs one entry — never per-screen logic.
preloadNavRailLibraries() Future<void>
Sequentially fires loadLibrary() for the seven nav-rail destinations so dart2js fetches each .part.js chunk in the background. Once each future resolves, DeferredScreen.markLoaded is called so the next mount renders synchronously without a FutureBuilder waiting frame.