Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

04 — Design System Mapping (Shared)

Maps Material 3 + Flutter widgets to the StudyLyon token set. Module docs 11_Design_System_Mapping.md extend this with module-specific components.


1. Theme

ConcernValue
FrameworkFlutter Material 3 (useMaterial3: true)
ColorSchemeColorScheme.fromSeed(seedColor: primary) + overrides from 02_Design_Tokens.md
ThemeDataOne AppTheme.light() / AppTheme.dark(); themeMode from system or org branding
Text themeTextTheme from 02_Design_Tokens.md §2
SpacingAppSpacing extension class (semantic xs/s/item-spacing.24/m/l/xl + fixed scale)
RadiusAppRadius class (r-micro … r-full)
ElevationAppElevation class; shadow tokens via BoxShadow/elevation params
MotionAppMotion class (durations + Curves)
Localizationflutter_localizations + Intl; MaterialApp.localizationsDelegates
FontsTheme font Inter (default); mono via JetBrains Mono (fontFamilyFallback)

2. Widget → token mapping (core)

Flutter widgetM3 roleStudyLyon token
FilledButtonPrimaryprimary/onPrimary, r-md, m-fast ripple
FilledButton.tonalSecondarysecondaryContainer/onSecondaryContainer
OutlinedButtonTertiaryoutline, onSurface, r-md
TextButtonText actionprimary
IconButtonIcon actiononSurfaceVariant, tooltip required
TextFieldFilled inputfill surfaceVariant, border outline, focus primary, r-md
CardElevated cardsurfaceContainerLow, e-1, r-lg
ListTileList rowsurface, height 56, onSurface/onSurfaceVariant
NavigationBarBottom navsurfaceContainer, indicator secondaryContainer, 64 h
NavigationRailTablet/desktop navsurfaceContainerLow, indicator secondaryContainer
NavigationDrawerDrawersurfaceContainerLow, e-4, width 320
AppBarTop barsurface, titleLarge, centerTitle false (phone), true (desktop)
TabBarSection tabsindicator primary, labelLarge
FloatingActionButtonPrimary actionprimaryContainer, e-3, 56 dp
Dialog/AlertDialogDialogsurfaceContainerHigh, e-4, r-lg
BottomSheetSheetsurfaceContainerHigh, e-5, r-xl top corners
SnackBarToastinverseSurface, m-base slide
Chip (Filter/Input)Chipselected secondaryContainer, else surfaceVariant
Switch/Checkbox/RadioToggleprimary selected, onSurfaceVariant unselected
SliderSliderprimary, e-0
LinearProgressIndicatorProgressprimary, surfaceVariant track
RefreshIndicatorPull-refreshprimary spinner
BadgeBadgeerror for counts, tertiary for dues
TooltipTooltipinverseSurface, m-fast
HeroHero transitionm-slow flight
SemanticsA11y labelsall interactive nodes labeled

3. Typography mapping

M3 tokenTextTheme memberTypical widget
displaySmalldisplaySmallEmpty states
headlineMediumheadlineMediumScreen titles
titleLargetitleLargeCard/dialog titles
titleMediumtitleMediumSection headers, list titles
bodyLargebodyLargeBody, descriptions
bodyMediumbodyMediumLabels, secondary
bodySmallbodySmallCaptions, timestamps
labelLargelabelLargeButtons, tabs
labelMediumlabelMediumBadges
labelSmalllabelSmallOverlines

4. Iconography

  • Pack: Material Symbols outlined; 24 dp default; status icons filled.
  • Sizing: 16 (dense rows), 20 (menu), 24 (default), 32 (empty state), 40 (headers).
  • Color: onSurfaceVariant default; primary active; error destructive.

5. Motion mapping

UseTokenFlutter
Page transitionm-base 250 msPageTransitionsTheme (FadeUpwards on Android, Cupertino on iOS)
Dialog/sheetm-baseshowDialog/showModalBottomSheet defaults
Herom-slow 400 msHero widget
Ripplem-fast 150 msInkWell/InkResponse
Hover/focusm-fastMouseRegion + AnimatedContainer/focus ring
List entrancem-entrance stagger 40 msAnimatedList/explicit TweenAnimationBuilder
Skeleton shimmerm-slow loopcustom AnimatedBuilder
Snackbarm-baseScaffoldMessenger

6. Layout tokens

TokenValue
Screen horizontal padding16 (phone), 24 (tablet/desktop)
Card padding16
Card gap12
Section gap24
Toolbar64
Bottom nav height64
List row56
Master-detail breakpoint840 dp

7. Theming rules (enforced)

  1. No literal Color in widget code — context.colorScheme.* / AppTokens.* only.
  2. No literal padding/margin — AppSpacing.* only.
  3. No literal durations — AppMotion.* only.
  4. Dark mode is a first-class theme, not an overlay.
  5. Tenant branding overrides primary at runtime via ThemeData copy.

8. Web/desktop (Flutter Web + Windows/macOS/Linux)

  • Hover states on all tappables (MouseRegion), focus rings (FocusTraversalGroup), keyboard shortcuts (Shortcuts/Actions), ESC closes dialogs/sheets/menus.
  • Responsive layout via LayoutBuilder breakpoints (02_Design_Tokens.md §8).
  • Scrollbars always visible on desktop.