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:
2026-11-11 11:46:13 +00:00
parent 1c2bb8733a
commit fbe1928f59
52 changed files with 1524 additions and 2947 deletions
@@ -1,7 +1,6 @@
import '../../../../ui/adaptive/segmented_bar.dart';
import 'dart:typed_data';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// The accessible name and visible label of the viewer's close control.
@@ -35,34 +34,13 @@ class ChatImageViewer extends StatelessWidget {
key: const Key('chat-image-viewer-image'),
fit: BoxFit.contain,
gaplessPlayback: true,
errorBuilder: (context, _, _) => Icon(
cupertino ? CupertinoIcons.photo : Icons.broken_image_outlined,
),
errorBuilder: (context, _, _) =>
const Icon(Icons.broken_image_outlined),
),
),
),
);
void close() => Navigator.of(context).maybePop();
if (cupertino) {
return CupertinoPageScaffold(
backgroundColor: CupertinoColors.black,
navigationBar: SegmentedBar(
cupertino: true,
automaticallyImplyLeading: false,
title: name,
backgroundColor: CupertinoColors.black,
pillColor: CupertinoColors.darkBackgroundGray,
foregroundColor: CupertinoColors.white,
leading: CupertinoButton(
key: const Key('chat-image-viewer-close'),
padding: const EdgeInsets.symmetric(horizontal: 16),
onPressed: close,
child: const Text(chatImageViewerClose),
),
),
child: body,
);
}
return Scaffold(
extendBodyBehindAppBar: true,
backgroundColor: Colors.black,
@@ -93,8 +71,7 @@ Future<void> openChatImageViewer(
required bool cupertino,
}) {
final page = ChatImageViewer(name: name, bytes: bytes, cupertino: cupertino);
final route = cupertino
? CupertinoPageRoute<void>(fullscreenDialog: true, builder: (_) => page)
: MaterialPageRoute<void>(fullscreenDialog: true, builder: (_) => page);
return Navigator.of(context).push(route);
return Navigator.of(
context,
).push(MaterialPageRoute<void>(fullscreenDialog: true, builder: (_) => page));
}