Chat stack: polish pile layers, dark tone, Add chat picker title, probe param

This commit is contained in:
2026-12-03 20:18:14 +00:00
parent fd62df3815
commit e629d552c2
7 changed files with 39 additions and 26 deletions
@@ -16,45 +16,41 @@ const double kChatStackPitch = kChatStackSlot + 8;
/// The gap between an item's name label and its avatar.
const double kChatStackLabelGap = 10;
/// An opaque disc in the design's shape (a circle, or a framed square under a
/// flat design) that carries one avatar of the stack. The list avatar's fill
/// is translucent; the disc keeps stacked avatars from showing through each
/// other, and its rim separates them. A raised design drops a short shadow;
/// a flat one keeps its hairline frame instead.
/// An opaque disc in the design's shape (a circle, or the design's square
/// under a flat design) that carries one avatar of the stack. The list
/// avatar's fill is translucent; the disc keeps stacked avatars from showing
/// through each other, and its rim separates them. A raised design drops a
/// short shadow; a flat one casts none, and its avatar frames itself.
class ChatStackDisc extends StatelessWidget {
const ChatStackDisc({
super.key,
required this.child,
this.ring,
this.shadow = true,
});
const ChatStackDisc({super.key, required this.child, this.ring});
final Widget child;
/// The rim's colour when it marks the current chat; null for the surface.
final Color? ring;
/// Whether this disc may cast a shadow (a layer under another does not).
final bool shadow;
@override
Widget build(BuildContext context) {
final tokens = AppDesignTokens.of(context);
final scheme = Theme.of(context).colorScheme;
final base = tokens.panelFill(scheme, scheme.surface);
// A raised dark design lifts the disc a tone, as Material's dark
// elevation does, so the pile's layers read where a shadow cannot.
final dark = Theme.of(context).brightness == Brightness.dark;
final base = tokens.panelFill(
scheme,
dark ? scheme.surfaceContainerHighest : scheme.surface,
);
final ring = this.ring;
final shape = chatStackShape(tokens);
final frame = tokens.frameSide;
return SizedBox.square(
dimension: kChatStackSlot,
child: Center(
child: DecoratedBox(
decoration: ShapeDecoration(
color: ring ?? base,
shape: shape.copyWith(
side: ring == null && frame != null ? frame : BorderSide.none,
),
shadows: shadow && !tokens.flat ? chatStackShadows(scheme) : null,
// A flat design's avatar frames itself; the rim stays bare.
shape: shape,
shadows: !tokens.flat ? chatStackShadows(scheme) : null,
),
child: SizedBox.square(
dimension: kChatStackDisc,