Files
pipelines/app/lib/features/chat/ui/transcript/chat_attachment_frame.dart
T
alan 7d2c3412a1 Paper design: warm paper, serif reading text and a typeset transcript
Adds the Paper design and generalises design tokens (transcript, composer,
selected-row styles, reading type, panel fill, chat colour saturation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 18:00:07 +00:00

34 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import '../../../../ui/theme/app_design_tokens.dart';
/// Rounds an attachment thumbnail and draws a subtle hairline around it, so a
/// dark screenshot on a dark page (or a light one on a light page) still reads
/// as a separate object. The line sits over the image's edge, in the host's
/// own outline role. A design with its own corners ([AppDesignTokens.radius])
/// rounds it with those.
class ChatAttachmentFrame extends StatelessWidget {
const ChatAttachmentFrame({
super.key,
required this.radius,
required this.child,
});
final BorderRadius radius;
final Widget child;
@override
Widget build(BuildContext context) {
final line = Theme.of(context).colorScheme.outlineVariant;
final radius = AppDesignTokens.of(context).corners(this.radius);
return Container(
key: const Key('chat-attachment-frame'),
foregroundDecoration: BoxDecoration(
borderRadius: radius,
border: Border.all(color: line.withValues(alpha: 0.8)),
),
child: ClipRRect(borderRadius: radius, child: child),
);
}
}