Complete Material-only APIs and fixtures

Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
This commit is contained in:
2026-11-11 21:55:39 +00:00
parent 63b2fd12cd
commit 9551eceaed
222 changed files with 540 additions and 1351 deletions
@@ -55,7 +55,6 @@ Future<void> _pumpShell(
child: child!,
),
home: AdaptiveShell(
cupertino: false,
destination: AppDestination.chat,
destinationBodies: {
AppDestination.chat: (_) => ChatScreen(gateway: gateway),
@@ -64,7 +64,6 @@ Future<_Gateway> _pumpShell(
MaterialApp(
theme: ThemeData(platform: platform, brightness: brightness),
home: AdaptiveShell(
cupertino: false,
destination: AppDestination.chat,
destinationBodies: {
AppDestination.chat: (_) => ChatScreen(gateway: gateway),
@@ -182,7 +182,6 @@ void main() {
test('the route reads its timing from Motion', () {
final route = ContainerTransformPageRoute<void>(
link: ContainerTransformLink(() => null),
cupertino: false,
builder: (_) => const SizedBox(),
);
expect(route.transitionDuration, Motion.containerTransform);
@@ -102,7 +102,7 @@ Future<void> _pump(
}
/// The mode the drawn control names, or null when the bar has none. A
/// Cupertino phone bar draws only the shield, so read the control itself.
/// A narrow phone bar draws only the shield, so read the control itself.
String? _shown(WidgetTester tester) {
if (_modeControl.evaluate().isEmpty) return null;
final control = find.byType(ChatModeControl);
@@ -112,7 +112,7 @@ String? _shown(WidgetTester tester) {
void main() {
for (final platform in [TargetPlatform.android, TargetPlatform.iOS]) {
final style = platform == TargetPlatform.iOS ? 'Cupertino' : 'Material';
final style = 'Material on ${platform.name}';
testWidgets(
'$style: an existing chat opened from the list shows its mode',
@@ -64,7 +64,6 @@ Future<_Gateway> _setup(WidgetTester tester, {bool inShell = false}) async {
inShell
? MaterialApp(
home: AdaptiveShell(
cupertino: false,
destination: AppDestination.chat,
destinationBodies: {
AppDestination.chat: (_) => ChatScreen(gateway: gateway),
@@ -58,7 +58,6 @@ Future<void> _mount(WidgetTester tester, Size size) async {
MaterialApp(
theme: ThemeData(platform: TargetPlatform.android),
home: AdaptiveShell(
cupertino: false,
destination: AppDestination.chat,
destinationBodies: {
AppDestination.chat: (_) => ChatScreen(gateway: gateway),
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -17,7 +16,6 @@ void main() {
await pumpIosMaterialChat(tester, FakeChatGateway());
expect(find.byType(Scaffold), findsWidgets);
expect(find.byType(CupertinoPageScaffold), findsNothing);
const message = 'No chat sessions on this server yet.';
expect(find.text(message), findsOneWidget);
@@ -42,7 +40,15 @@ void main() {
expect(find.text(message), findsOneWidget);
expectNormalTextStyle(tester, message);
expect(find.text('No chat sessions on this server yet.'), findsNothing);
expect(find.widgetWithText(CupertinoButton, 'Retry'), findsNothing);
expect(
find.ancestor(
of: find.text('Retry'),
matching: find.byWidgetPredicate(
(widget) => widget is ButtonStyleButton,
),
),
findsOneWidget,
);
expect(find.text('Retry'), findsOneWidget);
});
}
@@ -56,8 +56,7 @@ Future<void> pumpMaterialChat(
await tester.pumpAndSettle();
}
/// The screen's iOS/macOS path: Cupertino controls under the app's ordinary
/// `MaterialApp` root, with no Material or CupertinoTheme ancestor.
/// The screen's iOS/macOS path uses the same ordinary Material app root.
Future<void> pumpIosMaterialChat(
WidgetTester tester,
FakeChatGateway gateway, {
@@ -69,7 +69,7 @@ void main() {
await tester.pumpAndSettle();
final context = tester.element(find.byType(ChatMessageView));
final fontSize = chatMessageTextStyle(context, false)!.fontSize!;
final fontSize = chatMessageTextStyle(context)!.fontSize!;
final line = fontSize * scale;
Rect rect(String text) =>
tester.getRect(find.textContaining(text, findRichText: true).first);