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:typed_data';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../data/chat_attachment_images.dart';
|
||||
@@ -87,9 +86,7 @@ class _ChatAttachmentThumbnailState extends State<ChatAttachmentThumbnail> {
|
||||
Widget _decoding(BuildContext context) => SizedBox.square(
|
||||
dimension: 96,
|
||||
child: ColoredBox(
|
||||
color: widget.cupertino
|
||||
? CupertinoColors.systemGrey5.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -97,11 +94,7 @@ class _ChatAttachmentThumbnailState extends State<ChatAttachmentThumbnail> {
|
||||
Widget _pending(BuildContext context) => SizedBox.square(
|
||||
key: const Key('chat-attachment-thumbnail-loading'),
|
||||
dimension: 96,
|
||||
child: Center(
|
||||
child: widget.cupertino
|
||||
? const CupertinoActivityIndicator()
|
||||
: const CircularProgressIndicator(),
|
||||
),
|
||||
child: const Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
|
||||
Widget _thumbnail(BuildContext context, Uint8List bytes) {
|
||||
@@ -147,30 +140,20 @@ class _ChatAttachmentThumbnailState extends State<ChatAttachmentThumbnail> {
|
||||
label: widget.name,
|
||||
excludeSemantics: true,
|
||||
onTap: open,
|
||||
child: widget.cupertino
|
||||
? CupertinoButton(
|
||||
key: const Key('chat-attachment-thumbnail'),
|
||||
padding: EdgeInsets.zero,
|
||||
minimumSize: Size.zero,
|
||||
onPressed: open,
|
||||
child: constrained,
|
||||
)
|
||||
: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
key: const Key('chat-attachment-thumbnail'),
|
||||
borderRadius: _radius,
|
||||
onTap: open,
|
||||
child: constrained,
|
||||
),
|
||||
),
|
||||
child: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
key: const Key('chat-attachment-thumbnail'),
|
||||
borderRadius: _radius,
|
||||
onTap: open,
|
||||
child: constrained,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _placeholder(BuildContext context, String reason) {
|
||||
final secondary = widget.cupertino
|
||||
? CupertinoColors.secondaryLabel.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
final secondary = Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
return Semantics(
|
||||
key: const Key('chat-attachment-thumbnail-unavailable'),
|
||||
label: '${widget.name}, $reason',
|
||||
@@ -180,12 +163,7 @@ class _ChatAttachmentThumbnailState extends State<ChatAttachmentThumbnail> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
widget.cupertino
|
||||
? CupertinoIcons.photo
|
||||
: Icons.broken_image_outlined,
|
||||
color: secondary,
|
||||
),
|
||||
Icon(Icons.broken_image_outlined, color: secondary),
|
||||
const SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: Text(
|
||||
|
||||
Reference in New Issue
Block a user