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_test/flutter_test.dart';
|
||||
|
||||
@@ -57,21 +56,6 @@ Widget _materialHost(
|
||||
);
|
||||
}
|
||||
|
||||
Widget _cupertinoHost(JsonMap graph, {ValueChanged<String>? onSelected}) {
|
||||
return CupertinoApp(
|
||||
home: CupertinoPageScaffold(
|
||||
child: SizedBox(
|
||||
width: 900,
|
||||
height: 700,
|
||||
child: DefinitionGraphView(
|
||||
graph: graph,
|
||||
onSelected: onSelected ?? (_) {},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Settles the two-frame measure-then-place contract.
|
||||
Future<void> _settle(WidgetTester tester) async {
|
||||
await tester.pump();
|
||||
@@ -315,27 +299,4 @@ void main() {
|
||||
expect(find.byType(GraphStageNode), findsNothing);
|
||||
expect(find.byType(InteractiveViewer), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('cupertino host composes native buttons and keeps identity', (
|
||||
tester,
|
||||
) async {
|
||||
final picked = <String>[];
|
||||
await tester.pumpWidget(
|
||||
_cupertinoHost(linearGraph(), onSelected: picked.add),
|
||||
);
|
||||
await _settle(tester);
|
||||
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byType(GraphStageNode),
|
||||
matching: find.byType(CupertinoButton),
|
||||
),
|
||||
findsNWidgets(5),
|
||||
);
|
||||
expect(find.byType(Card), findsNothing);
|
||||
_expectNoOverlaps(tester);
|
||||
|
||||
await _tapNode(tester, '#failure');
|
||||
expect(picked, ['#failure']);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user