Remove Cupertino graph branches
Keep the Material graph implementation while preserving public Cupertino parameters for callers. Remove unreachable Cupertino widgets, routes, theme branches, imports, and Cupertino-only tests because the app runs exclusively under MaterialApp.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/semantics.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
@@ -113,35 +112,6 @@ Widget _materialHost(
|
||||
);
|
||||
}
|
||||
|
||||
Widget _cupertinoHost(
|
||||
JsonMap graph,
|
||||
JsonMap run, {
|
||||
ValueChanged<String>? onSelected,
|
||||
double scale = 1,
|
||||
}) {
|
||||
return CupertinoApp(
|
||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
||||
home: CupertinoPageScaffold(
|
||||
child: Builder(
|
||||
builder: (context) => MediaQuery(
|
||||
data: MediaQuery.of(
|
||||
context,
|
||||
).copyWith(textScaler: TextScaler.linear(scale)),
|
||||
child: SizedBox(
|
||||
width: 320,
|
||||
height: 700,
|
||||
child: RunGraphView(
|
||||
graph: graph,
|
||||
run: run,
|
||||
onStageSelected: onSelected ?? (_) {},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _settle(WidgetTester tester) async {
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
@@ -450,39 +420,4 @@ void main() {
|
||||
_expectNoOverlaps(tester);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('dark Cupertino host keeps native nodes and evidence', (
|
||||
tester,
|
||||
) async {
|
||||
final picked = <String>[];
|
||||
await tester.pumpWidget(
|
||||
_cupertinoHost(linearGraph(), _runningRun(), onSelected: picked.add),
|
||||
);
|
||||
await _settle(tester);
|
||||
|
||||
expect(find.byType(Card), findsNothing);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byType(GraphStageNode),
|
||||
matching: find.byType(CupertinoButton),
|
||||
),
|
||||
findsNWidgets(5),
|
||||
);
|
||||
expect(find.text(runGraphExecuted), findsOneWidget);
|
||||
expect(find.text(runGraphNotExecuted), findsOneWidget);
|
||||
expect(
|
||||
tester.widget<GraphStageNode>(_node('plan')).recordedStatus,
|
||||
'completed',
|
||||
);
|
||||
expect(
|
||||
tester.widget<GraphStageNode>(_node('build')).recordedStatus,
|
||||
'running',
|
||||
);
|
||||
_expectNoOverlaps(tester);
|
||||
|
||||
await tester.tap(_node('plan'));
|
||||
await tester.pump();
|
||||
expect(picked, ['plan']);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user