Remove Cupertino chat transcript branches
Keep the existing Material transcript path while preserving public Cupertino parameters for callers. Narrow transcript tests to the Material-only behavior and remove Cupertino-only fixtures.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
@@ -62,38 +61,13 @@ class _ChatCopyButtonState extends State<ChatCopyButton> {
|
||||
Widget build(BuildContext context) {
|
||||
final label = _copied ? chatCopiedLabel : chatCopyLabel;
|
||||
if (widget.showLabel) {
|
||||
final icon = Icon(
|
||||
_copied
|
||||
? (widget.cupertino ? CupertinoIcons.checkmark : Icons.check)
|
||||
: (widget.cupertino
|
||||
? CupertinoIcons.doc_on_doc
|
||||
: Icons.copy_outlined),
|
||||
);
|
||||
final icon = Icon(_copied ? Icons.check : Icons.copy_outlined);
|
||||
return Semantics(
|
||||
identifier: 'chat-code-copy',
|
||||
child: widget.cupertino
|
||||
? CupertinoButton(
|
||||
onPressed: _copy,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [icon, const SizedBox(width: 6), Text(label)],
|
||||
),
|
||||
)
|
||||
: TextButton.icon(onPressed: _copy, icon: icon, label: Text(label)),
|
||||
);
|
||||
}
|
||||
if (widget.cupertino) {
|
||||
return Semantics(
|
||||
button: true,
|
||||
label: label,
|
||||
excludeSemantics: true,
|
||||
child: CupertinoButton(
|
||||
key: const Key('chat-message-copy'),
|
||||
padding: EdgeInsets.zero,
|
||||
child: TextButton.icon(
|
||||
onPressed: _copy,
|
||||
child: Icon(
|
||||
_copied ? CupertinoIcons.checkmark : CupertinoIcons.doc_on_doc,
|
||||
),
|
||||
icon: icon,
|
||||
label: Text(label),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user