| j / k | Scroll down / up |
| gg | Scroll to top |
| G | Scroll to bottom |
| ⌘K / / | Open search |
| ? | Show this help |
| Esc | Close search / help |
| n / N | Next / previous section |
| h | Go to landing |
| d | Go to docs |
| : | Command mode — type section name |
Press ? or Esc to close
Full design token system. Runtime theme switching with zero refactor cost. All UI uses semantic tokens — never hardcoded values.
| Class | Role |
|---|---|
AppColors | Raw palette — never used directly in UI |
AppThemeColors | ThemeExtension with 40+ semantic properties. Access via context.colors.* |
AppTypography | TextStyle constants. Display · Heading · Body scales. Two font families. |
AppSpacing | Base scale s0–s1200. Aliases: xxs(4) xs(8) sm(12) md(16) lg(20) xl(24) xxl(32) xxxl(40) huge(48) |
AppShadows | Elevation shadow tokens |
class AppThemeColors extends ThemeExtension<AppThemeColors> {
// Backgrounds
final Color background;
final Color surface;
final Color surfaceSecondary;
final Color surfaceTertiary;
// Brand
final Color primary;
final Color primaryDark;
final Color primaryHover;
final Color primaryPressed;
// Text
final Color textPrimary;
final Color textSecondary;
final Color textTertiary;
final Color textDisabled;
final Color textPrimaryInv;
// Stroke
final Color border;
final Color divider;
// Status
final Color success;
final Color warning;
final Color error;
final Color info;
// ... 20+ more tokens
} class ThemeCubit extends Cubit<ThemeMode> {
final SharedPreferences _prefs;
ThemeCubit(this._prefs) : super(_loadSavedTheme());
void setLight() => _saveAndEmit(ThemeMode.light);
void setDark() => _saveAndEmit(ThemeMode.dark);
void toggle() => _saveAndEmit(state == ThemeMode.light ? ThemeMode.dark : ThemeMode.light);
ThemeData buildTheme() => ThemeData(
extensions: [AppThemeColors.light()],
// ...
);
} // Always use context.colors.* — never AppColors.*
Container(
color: context.colors.surface,
child: Text(
'Hello',
style: AppTypography.bodyMdRegular.copyWith(
color: context.colors.textPrimary,
),
),
);
// Spacing — never raw numbers
SizedBox(height: AppSpacing.md);
Padding(padding: .symmetric(horizontal: AppSpacing.lg)); AppColors.* directly in widgets. Always context.colors.* — the only API into the color system.