Remove Cupertino UI branches

Keep the public Cupertino-compatible parameters while retaining only the Material implementations and tests. The app is Material-only, so deleting unreachable Cupertino branches reduces dead code without changing the active path.
This commit is contained in:
2026-11-11 02:41:26 +00:00
parent 37cf9472c2
commit 9adee6cc60
29 changed files with 865 additions and 1744 deletions
@@ -294,59 +294,46 @@ void main() {
expect(tester.takeException(), isNull);
});
for (final cupertino in [false, true]) {
testWidgets('a file opens as a page that steps to the previous and next '
'file (${cupertino ? 'cupertino' : 'material'})', (tester) async {
tester.view.physicalSize = const Size(390, 844);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final viewer = ChangesViewer(
steps: [
stepFixture(
fileChanges: captureFixture(
files: [
fileChangeFixture(
path: 'lib/first.dart',
patch: multiHunkPatch,
),
fileChangeFixture(
path: 'lib/second.dart',
patch: multiHunkPatch,
),
],
),
testWidgets('a file opens as a page that steps to the previous and next '
'file', (tester) async {
tester.view.physicalSize = const Size(390, 844);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final viewer = ChangesViewer(
steps: [
stepFixture(
fileChanges: captureFixture(
files: [
fileChangeFixture(path: 'lib/first.dart', patch: multiHunkPatch),
fileChangeFixture(path: 'lib/second.dart', patch: multiHunkPatch),
],
),
],
);
await tester.pumpWidget(
cupertino ? cupertinoHost(viewer) : materialHost(viewer),
);
await tester.tap(find.byKey(const ValueKey('change-1-lib/first.dart')));
await tester.pumpAndSettle();
),
],
);
await tester.pumpWidget(materialHost(viewer));
await tester.tap(find.byKey(const ValueKey('change-1-lib/first.dart')));
await tester.pumpAndSettle();
Finder control(String label) =>
cupertino ? find.bySemanticsLabel(label) : find.byTooltip(label);
expect(find.byType(FileDiffPage), findsOneWidget);
expect(find.text('first.dart'), findsOneWidget);
expect(find.text('1 of 2'), findsOneWidget);
// The pager sits at the bottom right.
final pager = tester.getRect(
find.byKey(const ValueKey('file-diff-pager')),
);
expect(pager.bottom, greaterThan(844 - 120));
final next = tester.getRect(control('Next file'));
expect(next.right, greaterThan(390 - 80));
Finder control(String label) => find.byTooltip(label);
expect(find.byType(FileDiffPage), findsOneWidget);
expect(find.text('first.dart'), findsOneWidget);
expect(find.text('1 of 2'), findsOneWidget);
// The pager sits at the bottom right.
final pager = tester.getRect(find.byKey(const ValueKey('file-diff-pager')));
expect(pager.bottom, greaterThan(844 - 120));
final next = tester.getRect(control('Next file'));
expect(next.right, greaterThan(390 - 80));
await tester.tap(control('Next file'));
await tester.pumpAndSettle();
expect(find.text('second.dart'), findsOneWidget);
expect(find.text('2 of 2'), findsOneWidget);
await tester.tap(control('Previous file'));
await tester.pumpAndSettle();
expect(find.text('first.dart'), findsOneWidget);
expect(tester.takeException(), isNull);
});
}
await tester.tap(control('Next file'));
await tester.pumpAndSettle();
expect(find.text('second.dart'), findsOneWidget);
expect(find.text('2 of 2'), findsOneWidget);
await tester.tap(control('Previous file'));
await tester.pumpAndSettle();
expect(find.text('first.dart'), findsOneWidget);
expect(tester.takeException(), isNull);
});
final diffFile = FileChange(
path: 'lib/feature.dart',