Remove Cupertino chat conversation branches
Keep the Material-only conversation implementation while preserving public Cupertino parameters for callers. Narrow affected tests to Material hosts so the dead platform paths are no longer exercised.
This commit is contained in:
@@ -1,22 +1,17 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../domain/chat_task_metadata.dart';
|
||||
import '../../../ui/text/monospace.dart';
|
||||
import '../ui/sessions/chat_adaptive.dart';
|
||||
|
||||
bool taskCupertino(BuildContext context) =>
|
||||
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
|
||||
/// Always false: the app is Material-only. Kept so existing callers compile;
|
||||
/// a later run removes it with its callers.
|
||||
bool taskCupertino(BuildContext context) => false;
|
||||
|
||||
Color taskSecondary(BuildContext context) => taskCupertino(context)
|
||||
? CupertinoColors.secondaryLabel.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
Color taskSecondary(BuildContext context) =>
|
||||
Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
|
||||
TextStyle taskHeading(BuildContext context) => taskCupertino(context)
|
||||
? CupertinoTheme.of(
|
||||
context,
|
||||
).textTheme.textStyle.copyWith(fontWeight: FontWeight.w600)
|
||||
: Theme.of(context).textTheme.titleMedium ?? const TextStyle();
|
||||
TextStyle taskHeading(BuildContext context) =>
|
||||
Theme.of(context).textTheme.titleMedium ?? const TextStyle();
|
||||
|
||||
String taskDisplayTitle(Map<String, dynamic> shell) =>
|
||||
taskText(shell, 'description') ??
|
||||
@@ -65,12 +60,11 @@ String formatTaskDate(BuildContext context, DateTime time) {
|
||||
MaterialLocalizations,
|
||||
);
|
||||
final monthYear =
|
||||
material?.formatMonthYear(time) ??
|
||||
'${CupertinoLocalizations.of(context).datePickerMonth(time.month)} ${time.year}';
|
||||
material?.formatMonthYear(time) ?? '${time.month}/${time.year}';
|
||||
return '${time.day} $monthYear · ${time.hour.toString().padLeft(2, '0')}:${time.minute.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
/// Native grouped surface; callers supply content that grows with text scaling.
|
||||
/// A Material filled card; callers supply content that grows with text scaling.
|
||||
class ChatTaskSurface extends StatelessWidget {
|
||||
const ChatTaskSurface({
|
||||
super.key,
|
||||
@@ -81,16 +75,10 @@ class ChatTaskSurface extends StatelessWidget {
|
||||
final EdgeInsetsGeometry padding;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => taskCupertino(context)
|
||||
? CupertinoListSection.insetGrouped(
|
||||
margin: EdgeInsets.zero,
|
||||
backgroundColor: CupertinoColors.transparent,
|
||||
children: [Padding(padding: padding, child: child)],
|
||||
)
|
||||
: Card.filled(
|
||||
margin: EdgeInsets.zero,
|
||||
child: Padding(padding: padding, child: child),
|
||||
);
|
||||
Widget build(BuildContext context) => Card.filled(
|
||||
margin: EdgeInsets.zero,
|
||||
child: Padding(padding: padding, child: child),
|
||||
);
|
||||
}
|
||||
|
||||
class ChatTaskFact extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user