Complete Material-only APIs and fixtures
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
This commit is contained in:
@@ -18,13 +18,11 @@ class ChatAttachmentGallery extends StatelessWidget {
|
||||
super.key,
|
||||
required this.parts,
|
||||
required this.images,
|
||||
required this.cupertino,
|
||||
});
|
||||
|
||||
/// File parts for which [chatPartIsThumbnail] holds.
|
||||
final List<JsonMap> parts;
|
||||
final ChatAttachmentImages images;
|
||||
final bool cupertino;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Wrap(
|
||||
@@ -39,7 +37,6 @@ class ChatAttachmentGallery extends StatelessWidget {
|
||||
name: chatAttachmentPartName(part),
|
||||
uri: '${part['uri'] ?? ''}'.trim(),
|
||||
images: images,
|
||||
cupertino: cupertino,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -20,13 +20,11 @@ class ChatAttachmentThumbnail extends StatefulWidget {
|
||||
required this.name,
|
||||
required this.uri,
|
||||
required this.images,
|
||||
required this.cupertino,
|
||||
});
|
||||
|
||||
final String name;
|
||||
final String uri;
|
||||
final ChatAttachmentImages images;
|
||||
final bool cupertino;
|
||||
|
||||
@override
|
||||
State<ChatAttachmentThumbnail> createState() =>
|
||||
@@ -121,12 +119,8 @@ class _ChatAttachmentThumbnailState extends State<ChatAttachmentThumbnail> {
|
||||
_placeholder(context, 'Image could not be read'),
|
||||
),
|
||||
);
|
||||
void open() => openChatImageViewer(
|
||||
context,
|
||||
name: widget.name,
|
||||
bytes: bytes,
|
||||
cupertino: widget.cupertino,
|
||||
);
|
||||
void open() =>
|
||||
openChatImageViewer(context, name: widget.name, bytes: bytes);
|
||||
final constrained = ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: chatThumbnailMaxWidth,
|
||||
|
||||
@@ -11,13 +11,7 @@ class ChatCodeHover {
|
||||
Object? _active;
|
||||
bool _disposed = false;
|
||||
|
||||
void show(
|
||||
BuildContext context,
|
||||
Object token,
|
||||
String text,
|
||||
Offset pointer, {
|
||||
bool? cupertino,
|
||||
}) {
|
||||
void show(BuildContext context, Object token, String text, Offset pointer) {
|
||||
if (_disposed) return;
|
||||
hide();
|
||||
final overlay = Overlay.maybeOf(context, rootOverlay: true);
|
||||
@@ -128,12 +122,10 @@ class ChatCodeCopyRegion extends StatefulWidget {
|
||||
const ChatCodeCopyRegion({
|
||||
super.key,
|
||||
required this.code,
|
||||
this.cupertino,
|
||||
required this.label,
|
||||
required this.child,
|
||||
});
|
||||
final String code;
|
||||
final bool? cupertino;
|
||||
final Widget label, child;
|
||||
@override
|
||||
State<ChatCodeCopyRegion> createState() => _ChatCodeCopyRegionState();
|
||||
|
||||
@@ -9,16 +9,10 @@ const String chatImageViewerClose = 'Close';
|
||||
/// One attached image full screen: pinch or scroll to zoom, drag to pan once
|
||||
/// zoomed, and the host's own close control in the navigation bar.
|
||||
class ChatImageViewer extends StatelessWidget {
|
||||
const ChatImageViewer({
|
||||
super.key,
|
||||
required this.name,
|
||||
required this.bytes,
|
||||
required this.cupertino,
|
||||
});
|
||||
const ChatImageViewer({super.key, required this.name, required this.bytes});
|
||||
|
||||
final String name;
|
||||
final Uint8List bytes;
|
||||
final bool cupertino;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -45,7 +39,6 @@ class ChatImageViewer extends StatelessWidget {
|
||||
extendBodyBehindAppBar: true,
|
||||
backgroundColor: Colors.black,
|
||||
appBar: SegmentedBar(
|
||||
cupertino: false,
|
||||
automaticallyImplyLeading: false,
|
||||
leading: IconButton(
|
||||
key: const Key('chat-image-viewer-close'),
|
||||
@@ -68,9 +61,8 @@ Future<void> openChatImageViewer(
|
||||
BuildContext context, {
|
||||
required String name,
|
||||
required Uint8List bytes,
|
||||
required bool cupertino,
|
||||
}) {
|
||||
final page = ChatImageViewer(name: name, bytes: bytes, cupertino: cupertino);
|
||||
final page = ChatImageViewer(name: name, bytes: bytes);
|
||||
return Navigator.of(
|
||||
context,
|
||||
).push(MaterialPageRoute<void>(fullscreenDialog: true, builder: (_) => page));
|
||||
|
||||
@@ -116,7 +116,7 @@ class _ChatAgentReportCardState extends State<ChatAgentReportCard> {
|
||||
? Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(12, 0, 12, 12),
|
||||
child: DefaultTextStyle.merge(
|
||||
style: chatMessageTextStyle(context, false),
|
||||
style: chatMessageTextStyle(context),
|
||||
child:
|
||||
widget.textBuilder?.call(context, content.text) ??
|
||||
SelectableText(content.text),
|
||||
|
||||
@@ -71,7 +71,7 @@ class ChatAgentSurface extends StatelessWidget {
|
||||
|
||||
/// The transcript's reading text: the host's large body role, so answers read
|
||||
/// at a comfortable size and still follow the operator's text scaling.
|
||||
TextStyle? chatMessageTextStyle(BuildContext context, [bool? cupertino]) =>
|
||||
TextStyle? chatMessageTextStyle(BuildContext context) =>
|
||||
Theme.of(context).textTheme.bodyLarge;
|
||||
|
||||
/// The empty-line gap between two paragraphs of a reply: about one line of
|
||||
|
||||
@@ -55,7 +55,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
// that shrinks to its content; the agent's answer sits on the page with no
|
||||
// bubble, so long replies read as a document rather than a balloon.
|
||||
final body = DefaultTextStyle.merge(
|
||||
style: chatMessageTextStyle(context, false),
|
||||
style: chatMessageTextStyle(context),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -127,7 +127,6 @@ class ChatMessageView extends StatelessWidget {
|
||||
ChatAttachmentGallery(
|
||||
parts: thumbnails,
|
||||
images: images ?? _inlineImages,
|
||||
cupertino: false,
|
||||
),
|
||||
if (thumbnails.isNotEmpty && content.isNotEmpty)
|
||||
const SizedBox(height: 6),
|
||||
@@ -284,7 +283,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
// empty line between consecutive ones keeps them reading as paragraphs.
|
||||
final gap = chatParagraphGap(
|
||||
context,
|
||||
chatMessageTextStyle(context, false)?.fontSize,
|
||||
chatMessageTextStyle(context)?.fontSize,
|
||||
);
|
||||
var previousText = false;
|
||||
for (var index = 0; index < parts.length; index++) {
|
||||
|
||||
@@ -28,7 +28,7 @@ class ChatTurnChip extends StatelessWidget {
|
||||
final Widget? sheet;
|
||||
|
||||
/// A custom presentation (a full-screen route on a narrow window).
|
||||
final Future<void> Function(BuildContext context, bool cupertino)? open;
|
||||
final Future<void> Function(BuildContext context)? open;
|
||||
|
||||
/// Shrink a long label to one ellipsized line. Only for a chip whose parent
|
||||
/// bounds its width (a turn footer's Wrap, an aligned row).
|
||||
@@ -91,7 +91,7 @@ class ChatTurnChip extends StatelessWidget {
|
||||
}
|
||||
|
||||
Future<void> _open(BuildContext context) {
|
||||
if (open case final open?) return open(context, false);
|
||||
if (open case final open?) return open(context);
|
||||
return showChatTurnSheet(context, sheet!);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,7 @@ class ChatTurnDiffChip extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
// The flag is unused: the Material presentation is the only one.
|
||||
Future<void> _open(BuildContext context, bool cupertino) {
|
||||
Future<void> _open(BuildContext context) {
|
||||
// A dialog in the tiled app on a wide layout. A phone keeps the
|
||||
// full-screen page, and a floating window opens it as a page of that
|
||||
// window, so what it opens next (a diff, a command's output) stays in
|
||||
|
||||
@@ -46,7 +46,6 @@ class ChatShownHtmlCard extends StatelessWidget {
|
||||
// The Material host: the route is a MaterialPageRoute whatever
|
||||
// this flag says, so the flag is always false here.
|
||||
artifactFullscreenRoute(
|
||||
cupertino: false,
|
||||
builder: (_) => ChatShownHtmlPage(
|
||||
title: title,
|
||||
html: html,
|
||||
|
||||
Reference in New Issue
Block a user