@@ -156,6 +156,9 @@ void main() {
156
156
(WidgetTester tester) async {
157
157
await _loadInspectorUI (tester);
158
158
159
+ // Toggle implementation widgets on.
160
+ await _toggleImplementationWidgets (tester);
161
+
159
162
// Before hidden widgets are expanded, confirm the HeroControllerScope
160
163
// is hidden:
161
164
final hideableNodeFinder = findNodeMatching ('HeroControllerScope' );
@@ -207,6 +210,9 @@ void main() {
207
210
) async {
208
211
await _loadInspectorUI (tester);
209
212
213
+ // Toggle implementation widgets on.
214
+ await _toggleImplementationWidgets (tester);
215
+
210
216
// Before searching, confirm the HeroControllerScope is hidden:
211
217
final hideableNodeFinder = findNodeMatching ('HeroControllerScope' );
212
218
expect (hideableNodeFinder, findsNothing);
@@ -239,21 +245,15 @@ void main() {
239
245
) async {
240
246
await _loadInspectorUI (tester);
241
247
242
- // Give time for the initial animation to complete .
243
- await tester. pumpAndSettle (inspectorChangeSettleTime );
248
+ // Toggle implementation widgets on .
249
+ await _toggleImplementationWidgets (tester );
244
250
245
251
// Confirm the hidden widgets are visible behind affordances like "X more
246
252
// widgets".
247
253
expect (find.richTextContaining ('more widgets...' ), findsWidgets);
248
254
249
- // Tap the "Show Implementation Widgets" button (selected by default).
250
- final showImplementationWidgetsButton = find.descendant (
251
- of: find.byType (DevToolsToggleButton ),
252
- matching: find.text ('Show Implementation Widgets' ),
253
- );
254
- expect (showImplementationWidgetsButton, findsOneWidget);
255
- await tester.tap (showImplementationWidgetsButton);
256
- await tester.pumpAndSettle (inspectorChangeSettleTime);
255
+ // Toggle implementation widgets off.
256
+ await _toggleImplementationWidgets (tester);
257
257
258
258
// Confirm that the hidden widgets are no longer visible.
259
259
expect (find.richTextContaining ('more widgets...' ), findsNothing);
@@ -287,6 +287,10 @@ void main() {
287
287
) async {
288
288
// Load the Inspector.
289
289
await _loadInspectorUI (tester);
290
+
291
+ // Toggle implementation widgets on.
292
+ await _toggleImplementationWidgets (tester);
293
+
290
294
await tester.pumpAndSettle (inspectorChangeSettleTime);
291
295
final state =
292
296
tester.state (find.byType (InspectorScreenBody ))
@@ -300,14 +304,8 @@ void main() {
300
304
diagnostics.firstWhere ((d) => d? .description == 'Text' )! ;
301
305
expect (textDiagnostic.isCreatedByLocalProject, isTrue);
302
306
303
- // Tap the "Show Implementation Widgets" button (selected by default).
304
- final showImplementationWidgetsButton = find.descendant (
305
- of: find.byType (DevToolsToggleButton ),
306
- matching: find.text ('Show Implementation Widgets' ),
307
- );
308
- expect (showImplementationWidgetsButton, findsOneWidget);
309
- await tester.tap (showImplementationWidgetsButton);
310
- await tester.pumpAndSettle (inspectorChangeSettleTime);
307
+ // Toggle implementation widgets off.
308
+ await _toggleImplementationWidgets (tester);
311
309
312
310
// Verify the Text diagnostic node is still in the tree.
313
311
final diagnosticsNow = state.controller.inspectorTree.rowsInTree.value.map (
@@ -505,6 +503,9 @@ void main() {
505
503
) async {
506
504
await _loadInspectorUI (tester);
507
505
506
+ // Toggle implementation widgets on.
507
+ await _toggleImplementationWidgets (tester);
508
+
508
509
// Give time for the initial animation to complete.
509
510
await tester.pumpAndSettle (inspectorChangeSettleTime);
510
511
@@ -596,6 +597,17 @@ void main() {
596
597
});
597
598
}
598
599
600
+ Future <void > _toggleImplementationWidgets (WidgetTester tester) async {
601
+ // Tap the "Show Implementation Widgets" button (selected by default).
602
+ final showImplementationWidgetsButton = find.descendant (
603
+ of: find.byType (DevToolsToggleButton ),
604
+ matching: find.text ('Show Implementation Widgets' ),
605
+ );
606
+ expect (showImplementationWidgetsButton, findsOneWidget);
607
+ await tester.tap (showImplementationWidgetsButton);
608
+ await tester.pumpAndSettle (inspectorChangeSettleTime);
609
+ }
610
+
599
611
Future <void > _loadInspectorUI (WidgetTester tester) async {
600
612
final screen = InspectorScreen ();
601
613
await tester.pumpWidget (
0 commit comments