import 'package:flutter/material.dart'; import 'app_design_tokens.dart'; import 'app_theme.dart'; import 'terminal_theme.dart'; /// An app-wide design: how every surface is shaped, typed and coloured, not /// only a colour. Each design builds a light and a dark [ThemeData] carrying /// its [AppDesignTokens], so widgets that draw design-specific shapes read the /// tokens instead of hard-coding one look. /// /// Adding a design means one more value here and its theme builder; the /// Settings picker lists [AppDesign.values]. enum AppDesign { /// The app's own Material look. standard('default', 'Default', 'The app’s Material look.'), /// A terminal-style look: monospace text, near-black pages, thin frames /// and a transcript drawn as prompt and tool lines. terminal( 'terminal', 'Terminal', 'Monospace, flat frames and prompt-style chat, like a CLI agent.', ); const AppDesign(this.id, this.label, this.description); /// The stored value; stable across releases and renames. final String id; /// The picker's name for the design. final String label; /// The picker's one-line summary of the design. final String description; /// The design stored as [id], or [standard] for an unknown or missing id. static AppDesign fromId(String? id) { for (final design in values) { if (design.id == id) return design; } return standard; } /// The design's light theme. [fontFamily] is the device's interface font; /// a design with its own family (Terminal's monospace) keeps that instead. ThemeData light({String? fontFamily}) => switch (this) { standard => appLightTheme(fontFamily: fontFamily), terminal => terminalTheme(Brightness.light), }; /// The design's dark theme; see [light]. ThemeData dark({String? fontFamily}) => switch (this) { standard => appDarkTheme(fontFamily: fontFamily), terminal => terminalTheme(Brightness.dark), }; /// Whether the device's interface font applies under this design. bool get usesInterfaceFont => this == standard; }