Merge main (High contrast) into Glass; Glass snaps live switches

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-04 00:46:54 +00:00
40 changed files with 2732 additions and 103 deletions
@@ -206,7 +206,10 @@ class ChatStackLabel extends StatelessWidget {
);
final color = this.color;
final dark = theme.brightness == Brightness.dark;
final fill = color == null
// A design with a contrast floor marks the chat's colour with a bold
// outline rather than a tint.
final outlined = color != null && tokens.minContrast != null;
final fill = color == null || outlined
? base
: Color.alphaBlend(color.withValues(alpha: dark ? .22 : .14), base);
final style = (theme.textTheme.labelLarge ?? const TextStyle()).copyWith(
@@ -215,7 +218,10 @@ class ChatStackLabel extends StatelessWidget {
);
final rest = ShapeDecoration(
color: fill,
shape: _labelShape(tokens),
shape: _labelShape(
tokens,
outlined ? BorderSide(color: color, width: 3) : null,
),
shadows: tokens.flat ? null : chatStackShadows(scheme),
);
return chatStackLifted(
@@ -262,8 +268,8 @@ class ChatStackLabel extends StatelessWidget {
);
}
OutlinedBorder _labelShape(AppDesignTokens tokens) {
final side = tokens.frameSide ?? BorderSide.none;
OutlinedBorder _labelShape(AppDesignTokens tokens, [BorderSide? outline]) {
final side = outline ?? tokens.frameSide ?? BorderSide.none;
final r = tokens.radius;
return r == null
? StadiumBorder(side: side)