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
+29 -61
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/application/app.dart';
@@ -27,69 +26,38 @@ void main() {
expect(b?.fontSize, a?.fontSize);
expect(b?.fontWeight, a?.fontWeight);
}
expect(
build(
fontFamily: 'Inter',
).cupertinoOverrideTheme?.textTheme?.textStyle.fontFamily,
'Inter',
);
expect(build().cupertinoOverrideTheme, isNull);
}
});
test('the Cupertino theme takes the family in every text role', () {
expect(appCupertinoThemeWith(), same(appCupertinoTheme));
final text = appCupertinoThemeWith(fontFamily: 'Inter').textTheme;
const stock = CupertinoTextThemeData();
for (final (a, b) in <(TextStyle, TextStyle)>[
(stock.textStyle, text.textStyle),
(stock.navTitleTextStyle, text.navTitleTextStyle),
(stock.navLargeTitleTextStyle, text.navLargeTitleTextStyle),
(stock.tabLabelTextStyle, text.tabLabelTextStyle),
(stock.actionTextStyle, text.actionTextStyle),
(stock.pickerTextStyle, text.pickerTextStyle),
]) {
expect(b.fontFamily, 'Inter');
expect(b.fontSize, a.fontSize);
expect(b.fontWeight, a.fontWeight);
}
expect(
appCupertinoThemeWith(fontFamily: 'Inter').scaffoldBackgroundColor,
AppColors.background,
testWidgets('the Material host switches font live, without a restart', (
tester,
) async {
final fonts = AppFontController(
store: MemoryAppFontStore(),
loader: (family, assets) async {},
);
String? family;
await tester.pumpWidget(
MyApp(
fonts: fonts,
destination: AppDestination.settings,
destinationBodies: <AppDestination, WidgetBuilder>{
AppDestination.settings: (context) => Builder(
builder: (context) {
family = DefaultTextStyle.of(context).style.fontFamily;
return const Text('body');
},
),
},
),
);
final before = family;
expect(before, isNot('IBM Plex Sans'));
await fonts.select(AppFont.ibmPlexSans);
await tester.pumpAndSettle();
expect(family, 'IBM Plex Sans');
await fonts.select(AppFont.system);
await tester.pumpAndSettle();
expect(family, before);
});
for (final cupertino in <bool>[false, true]) {
testWidgets('the ${cupertino ? 'Cupertino' : 'Material'} host switches '
'font live, without a restart', (tester) async {
final fonts = AppFontController(
store: MemoryAppFontStore(),
loader: (family, assets) async {},
);
String? family;
await tester.pumpWidget(
MyApp(
cupertino: cupertino,
fonts: fonts,
destination: AppDestination.settings,
destinationBodies: <AppDestination, WidgetBuilder>{
AppDestination.settings: (context) => Builder(
builder: (context) {
family = DefaultTextStyle.of(context).style.fontFamily;
return const Text('body');
},
),
},
),
);
final before = family;
expect(before, isNot('IBM Plex Sans'));
await fonts.select(AppFont.ibmPlexSans);
await tester.pumpAndSettle();
expect(family, 'IBM Plex Sans');
await fonts.select(AppFont.system);
await tester.pumpAndSettle();
expect(family, before);
});
}
}
+5 -4
View File
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/ui/theme/app_theme.dart';
@@ -20,11 +19,13 @@ void main() {
}
});
test('the Cupertino page is gray in dark mode and unchanged in light', () {
test('page backgrounds are gray in dark mode and unchanged in light', () {
expect(AppColors.background.darkColor, const Color(0xFF141416));
expect(AppColors.background.color, const Color(0xFFFFFFFF));
expect(appCupertinoTheme.scaffoldBackgroundColor, AppColors.background);
expect(AppColors.groupedBackground.darkColor, isNot(CupertinoColors.black));
expect(
AppColors.groupedBackground.darkColor,
isNot(const Color(0xFF000000)),
);
});
test('Android pages retain native predictive Back in both themes', () {