App: add a selectable app design with a Terminal look
AppDesign builds each design's light and dark ThemeData with an AppDesignTokens extension (corner radius, flat surfaces, frame colour, ANSI accents, prompt glyph). Settings gains a Design picker stored per device; the theme hosts rebuild live. Terminal is monospace (bundled RobotoMono), near-black or paper, flat 1px frames with 3px corners, and draws the chat transcript as prompt lines, tool dot/result lines and bracketed follow-up lines. Default keeps its exact themes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../theme/app_design_tokens.dart';
|
||||
|
||||
/// The shared status glyph whose tooltip and accessible name say the state.
|
||||
///
|
||||
/// [state] is the normalised run state (`succeeded`, `failed`, `running`,
|
||||
@@ -20,7 +22,7 @@ class RunStatusIcon extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = runStatusColor(state, Theme.of(context).colorScheme);
|
||||
final color = runStatusColorOf(context, state);
|
||||
// The label is the glyph's accessible name; the tooltip must not repeat it.
|
||||
return Tooltip(
|
||||
message: label,
|
||||
@@ -35,6 +37,23 @@ class RunStatusIcon extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// [runStatusColor] as the design at [context] draws it: a design with ANSI
|
||||
/// accents (Terminal) names its own muted hues; the Default design keeps the
|
||||
/// system colours.
|
||||
Color runStatusColorOf(BuildContext context, String state) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final ansi = AppDesignTokens.of(context).ansi;
|
||||
if (ansi == null) return runStatusColor(state, scheme);
|
||||
return switch (state) {
|
||||
'succeeded' => ansi.green,
|
||||
'failed' => ansi.red,
|
||||
'running' || 'active' => ansi.blue,
|
||||
'waiting' || 'waiting_quota' => ansi.yellow,
|
||||
'interrupted' => ansi.magenta,
|
||||
_ => scheme.onSurfaceVariant,
|
||||
};
|
||||
}
|
||||
|
||||
/// The colour for a run state, shared by every status glyph: green
|
||||
/// succeeded, red failed, blue running, yellow waiting, orange interrupted,
|
||||
/// grey otherwise, each with a brighter dark-mode shade.
|
||||
@@ -75,7 +94,7 @@ class RunStatusKicker extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = runStatusColor(state, Theme.of(context).colorScheme);
|
||||
final color = runStatusColorOf(context, state);
|
||||
return Row(
|
||||
key: const Key('run-status-kicker'),
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
Reference in New Issue
Block a user