Files
pipelines/app/lib/features/chat/conversation/chat_bar_control_style.dart
T
alan b382ae7e03 Carry the chat colour in the thread bar instead of a page wash
Tint the bar's glass pieces with the chat shade over the raised surface
(0.16 light and dark, then the 0.82 glass opacity) and draw its labels in
the seeded scheme's onPrimaryContainer; Cupertino takes it as the bar's
primary colour. Inactive split panes keep half the tint. Remove
ChatColorWash. The composer focus ring is the seeded primary at full
opacity, 2 px, with no glow. Contrast test asserts AA for every palette
colour on both hosts in light and dark.
2026-11-10 00:18:23 +00:00

33 lines
1.1 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'chat_bar_tint.dart';
/// The conversation bar's model and mode controls read as the bar's other
/// actions do: neutral, not tinted like a primary call to action. In a
/// coloured chat's bar they take its foreground ([ChatBarTintScope]) instead.
///
/// Material: a [TextButton] style in the role the bar's icon buttons use
/// (`onSurfaceVariant`).
ButtonStyle chatBarTextButtonStyle(BuildContext context) =>
TextButton.styleFrom(
foregroundColor:
ChatBarTintScope.foregroundOf(context) ??
Theme.of(context).colorScheme.onSurfaceVariant,
);
/// Cupertino: [content] (a [CupertinoButton]'s child) in the label colour
/// instead of the button's tint.
Widget chatBarCupertinoContent(BuildContext context, Widget content) {
final color =
ChatBarTintScope.foregroundOf(context) ??
CupertinoColors.label.resolveFrom(context);
return IconTheme.merge(
data: IconThemeData(color: color),
child: DefaultTextStyle.merge(
style: TextStyle(color: color),
child: content,
),
);
}