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:
2026-11-11 21:55:39 +00:00
parent 63b2fd12cd
commit 9551eceaed
222 changed files with 540 additions and 1351 deletions
@@ -103,9 +103,8 @@ class _FolderPickerPageState extends State<FolderPickerPage> {
/// The app's segmented bar: Back (climbing one folder), the title, and
/// Cancel in the actions pill, each popping in like every other bar.
SegmentedBar _bar() => SegmentedBar(
cupertino: false,
automaticallyImplyLeading: false,
leading: SegmentedBackButton(cupertino: false, onPressed: _back),
leading: SegmentedBackButton(onPressed: _back),
title: widget.purpose.title,
actions: [
TextButton(
@@ -7,7 +7,6 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
required this.label,
required this.onPressed,
required this.materialIcon,
this.cupertinoIcon,
this.identifier,
});
@@ -15,10 +14,6 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
final VoidCallback onPressed;
final IconData materialIcon;
/// Compatibility for callers not yet migrated; Material always uses
/// [materialIcon].
final IconData? cupertinoIcon;
final String? identifier;
/// A narrow bar moves it into its More menu, under the bar's host's icon.
@@ -13,11 +13,10 @@ class ChatCompactAvatar extends StatelessWidget {
required this.running,
required this.backgroundTasks,
required this.unread,
required this.cupertino,
});
final String title;
final Color color;
final bool active, visible, running, unread, cupertino;
final bool active, visible, running, unread;
final int backgroundTasks;
@override
@@ -45,7 +44,6 @@ class ChatCompactAvatar extends StatelessWidget {
),
),
if (chatSessionActivityBadge(
cupertino: cupertino,
running: running,
backgroundTasks: backgroundTasks,
)
@@ -107,7 +107,6 @@ class ChatCompactSidebar extends StatelessWidget {
running: running,
backgroundTasks: backgroundTasks,
unread: unread,
cupertino: false,
),
if (machineName case final name?)
Text(
@@ -6,7 +6,6 @@ import 'chat_create_fields.dart';
class ChatPromptChooser extends StatelessWidget {
const ChatPromptChooser({
super.key,
required this.cupertino,
required this.enabled,
required this.choice,
required this.hasLastUsed,
@@ -18,8 +17,6 @@ class ChatPromptChooser extends StatelessWidget {
static const careful = 'careful';
static const lastUsed = 'last-used';
/// Kept for callers; the Material switch and picker are always drawn.
final bool cupertino;
final bool enabled;
final String choice;
final bool hasLastUsed;
@@ -417,11 +417,7 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
return Scaffold(
extendBodyBehindAppBar: true,
appBar: SegmentedBar(
cupertino: false,
title: 'Chats',
actions: _actions(),
),
appBar: SegmentedBar(title: 'Chats', actions: _actions()),
// The list scrolls behind the floating bar; New chat is the bar's
// own action, so there is no second create button.
body: body,
@@ -335,7 +335,6 @@ class _CreateChatDialogState extends State<CreateChatDialog> {
),
const SizedBox(height: 12),
ChatPromptChooser(
cupertino: false,
enabled: _sendPrompt,
choice: _promptChoice,
hasLastUsed: _savedPrompt?.text.trim().isNotEmpty == true,
@@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
/// background tasks still run, a quiet muted glyph (never a second spinner).
/// Null when the chat is idle.
Widget? chatSessionActivityBadge({
required bool cupertino,
required bool running,
required int backgroundTasks,
}) {
@@ -64,7 +64,7 @@ class ChatSessionRow extends StatelessWidget {
final accent = Theme.of(context).colorScheme.primary;
final shade = chatColorShade(context, chatSessionColor(session));
final marker = shade ?? accent;
final tint = AppListRow.tintFor(context, shade, cupertino: false);
final tint = AppListRow.tintFor(context, shade);
final background = Theme.of(context).scaffoldBackgroundColor;
// On a phone the chat's page grows out of this row and shrinks back
// into it; the surface it starts from is the row's tint over the list.
@@ -97,7 +97,6 @@ class ChatSessionRow extends StatelessWidget {
active: selected,
child: AppListRow(
key: Key('chat-row-$id'),
cupertino: false,
selected: selected,
selectedFill: Colors.transparent,
emphasized: unread,
@@ -236,7 +235,6 @@ class ChatSessionAvatar extends StatelessWidget {
foreground: mark,
background: fill,
badge: chatSessionActivityBadge(
cupertino: false,
running: running,
backgroundTasks: backgroundTasks,
),
@@ -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,