b00dff864c
Sent images and composer thumbnails share ChatAttachmentFrame: rounded corners plus a faint outline in the host's outline role, so a dark screenshot no longer melts into a dark page. Adds a web probe that renders the streaming activity line at several text sizes.
37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../sessions/chat_adaptive.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.
|
|
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 cupertino =
|
|
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
|
|
final line = cupertino
|
|
? CupertinoColors.separator.resolveFrom(context)
|
|
: Theme.of(context).colorScheme.outlineVariant;
|
|
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),
|
|
);
|
|
}
|
|
}
|