Remove Cupertino chat shell branches

Keep the Material-only chat shell path while preserving public Cupertino parameters for callers. Narrow matching tests to the supported Material host.
This commit is contained in:
2026-11-11 04:41:58 +00:00
parent 98e2abd9af
commit 8e98651db6
17 changed files with 172 additions and 460 deletions
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../conversation/chat_card_styles.dart';
@@ -24,46 +23,26 @@ class ChatShellStatus extends StatelessWidget {
return Semantics(
key: const Key('chat-shell-run-running'),
label: chatShellStatusLabel(run),
child: cupertino
? const CupertinoActivityIndicator()
// As tall as the line of text beside it, at any text scale.
: SizedBox.square(
dimension: MediaQuery.textScalerOf(context).scale(20),
child: const CircularProgressIndicator(strokeWidth: 2),
),
// As tall as the line of text beside it, at any text scale.
child: SizedBox.square(
dimension: MediaQuery.textScalerOf(context).scale(20),
child: const CircularProgressIndicator(strokeWidth: 2),
),
);
}
final label = run.durationMs > 0
? '${chatShellStatusLabel(run)} · ${chatShellDuration(run.durationMs)}'
: chatShellStatusLabel(run);
final color = switch (run.state) {
ChatShellRunState.succeeded =>
cupertino
? CupertinoColors.systemGreen.resolveFrom(context)
: Theme.of(context).colorScheme.primary,
ChatShellRunState.failed => chatCardErrorColor(context, cupertino),
_ => chatCardSecondaryColor(context, cupertino),
ChatShellRunState.succeeded => Theme.of(context).colorScheme.primary,
ChatShellRunState.failed => chatCardErrorColor(context, false),
_ => chatCardSecondaryColor(context, false),
};
final icon = switch (run.state) {
ChatShellRunState.succeeded =>
cupertino
? CupertinoIcons.checkmark_circle
: Icons.check_circle_outline,
ChatShellRunState.failed =>
cupertino ? CupertinoIcons.xmark_circle : Icons.error_outline,
_ => cupertino ? CupertinoIcons.stop_circle : Icons.stop_circle_outlined,
ChatShellRunState.succeeded => Icons.check_circle_outline,
ChatShellRunState.failed => Icons.error_outline,
_ => Icons.stop_circle_outlined,
};
if (cupertino) {
return Row(
key: const Key('chat-shell-run-status'),
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, color: color, size: 18),
const SizedBox(width: 4),
Text(label, style: chatCardSecondaryStyle(context, true)),
],
);
}
return Chip(
key: const Key('chat-shell-run-status'),
avatar: Icon(icon, color: color),