Remove Cupertino branches from runs UI

Keep the public cupertino parameters for compatibility while retaining only the Material rendering paths. Remove Cupertino-only widgets, routes, styling, and tests because the application runs under Material hosts.
This commit is contained in:
2026-11-11 16:06:54 +00:00
parent 706c460c6e
commit 4b4628f35c
14 changed files with 118 additions and 427 deletions
+14 -33
View File
@@ -1,9 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/segmented_bar.dart';
import '../../../core/api_gateway.dart';
import '../../../ui/adaptive/host.dart';
import '../../../ui/adaptive/floating_bar_layout.dart';
import '../../graph/domain/graph_definition.dart';
import '../../graph/widgets/run_graph_view.dart';
@@ -34,7 +32,6 @@ class RunGraphPreview extends StatelessWidget {
@override
Widget build(BuildContext context) {
final cupertino = usesCupertinoHost(context);
// No graph to draw: one muted line, with no frame and nothing to open.
if (graphNodes(graph).isEmpty) {
return Padding(
@@ -42,30 +39,24 @@ class RunGraphPreview extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
child: Text(
runGraphMissing,
style: cupertino
? CupertinoTheme.of(context).textTheme.textStyle.copyWith(
color: CupertinoColors.secondaryLabel.resolveFrom(context),
)
: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
);
}
final border = cupertino
? CupertinoColors.separator.resolveFrom(context)
: Theme.of(context).colorScheme.outlineVariant;
final border = Theme.of(context).colorScheme.outlineVariant;
return Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
child: Semantics(
button: true,
label: 'Run graph, open full screen',
excludeSemantics: true,
onTap: () => _open(context, cupertino),
onTap: () => _open(context),
child: GestureDetector(
key: runGraphPreviewKey,
behavior: HitTestBehavior.opaque,
onTap: () => _open(context, cupertino),
onTap: () => _open(context),
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(color: border),
@@ -100,7 +91,7 @@ class RunGraphPreview extends StatelessWidget {
);
}
Future<void> _open(BuildContext context, bool cupertino) {
Future<void> _open(BuildContext context) {
Widget graphView(BuildContext pageContext) => RunGraphView(
key: const Key('run-detail-graph'),
// Already full screen: no maximise button to open it again.
@@ -114,23 +105,13 @@ class RunGraphPreview extends StatelessWidget {
},
);
return Navigator.of(context).push<void>(
cupertino
? CupertinoPageRoute<void>(
builder: (page) => CupertinoPageScaffold(
navigationBar: const SegmentedBar(
cupertino: true,
title: 'Graph',
),
child: BelowTopBar(child: graphView(page)),
),
)
: MaterialPageRoute<void>(
builder: (page) => Scaffold(
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: 'Graph'),
body: BelowTopBar(child: graphView(page)),
),
),
MaterialPageRoute<void>(
builder: (page) => Scaffold(
extendBodyBehindAppBar: true,
appBar: const SegmentedBar(cupertino: false, title: 'Graph'),
body: BelowTopBar(child: graphView(page)),
),
),
);
}
}