Files
alan c75023eb40 Remove Cupertino chat workspace branches
Keep the app's Material-only chat workspace path while retaining public cupertino parameters for callers. Narrow the affected widget tests to the supported Material host.
2026-11-11 01:53:14 +00:00

58 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
/// A named, explicit switch action above the inactive transcript. It occupies
/// space rather than obscuring the small chat's readable content.
class ChatPeekHeader extends StatelessWidget {
const ChatPeekHeader({
super.key,
required this.title,
required this.onActivate,
});
final String title;
final VoidCallback onActivate;
@override
Widget build(BuildContext context) => LayoutBuilder(
builder: (context, constraints) {
final compact = constraints.maxHeight < 44;
final textStyle = compact
? Theme.of(context).textTheme.labelMedium
: Theme.of(context).textTheme.labelLarge;
final foreground = Theme.of(context).colorScheme.onSurface;
final background = Theme.of(context).colorScheme.surfaceContainer;
final content = Row(
children: [
Expanded(
child: Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: textStyle?.copyWith(color: foreground),
),
),
const SizedBox(width: 8),
Text('Switch', style: textStyle?.copyWith(color: foreground)),
const SizedBox(width: 4),
Icon(Icons.arrow_upward, color: foreground, size: 18),
],
);
return ColoredBox(
color: background,
child: Tooltip(
message: 'Switch to $title',
child: TextButton(
style: TextButton.styleFrom(
minimumSize: const Size(0, 44),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: const EdgeInsets.symmetric(horizontal: 12),
shape: const RoundedRectangleBorder(),
),
onPressed: onActivate,
child: content,
),
),
);
},
);
}