diff --git a/packages/flutter/test/cupertino/segmented_control_test.dart b/packages/flutter/test/cupertino/segmented_control_test.dart index 793c606e17..e669b63d9f 100644 --- a/packages/flutter/test/cupertino/segmented_control_test.dart +++ b/packages/flutter/test/cupertino/segmented_control_test.dart @@ -1106,7 +1106,7 @@ void main() { ); }, ), - const Duration(milliseconds: 40), + duration: const Duration(milliseconds: 40), ); expect(getBackgroundColor(tester, 0), const Color(0xff3d9aff)); expect(getBackgroundColor(tester, 1), const Color(0x64007aff)); @@ -1127,7 +1127,7 @@ void main() { ); }, ), - const Duration(milliseconds: 40), + duration: const Duration(milliseconds: 40), ); expect(getBackgroundColor(tester, 0), const Color(0xff7bbaff)); expect(getBackgroundColor(tester, 1), const Color(0x95007aff)); @@ -1148,7 +1148,7 @@ void main() { ); }, ), - const Duration(milliseconds: 40), + duration: const Duration(milliseconds: 40), ); expect(getBackgroundColor(tester, 0), const Color(0xffb9daff)); expect(getBackgroundColor(tester, 1), const Color(0xc7007aff)); @@ -1169,7 +1169,7 @@ void main() { ); }, ), - const Duration(milliseconds: 40), + duration: const Duration(milliseconds: 40), ); expect(getBackgroundColor(tester, 0), const Color(0xfff7faff)); expect(getBackgroundColor(tester, 1), const Color(0xf8007aff)); @@ -1190,7 +1190,7 @@ void main() { ); }, ), - const Duration(milliseconds: 40), + duration: const Duration(milliseconds: 40), ); expect(getBackgroundColor(tester, 0), isSameColorAs(CupertinoColors.white)); expect(getBackgroundColor(tester, 1), CupertinoColors.activeBlue); diff --git a/packages/flutter/test/material/button_bar_test.dart b/packages/flutter/test/material/button_bar_test.dart index 9207fc1395..3d14322e53 100644 --- a/packages/flutter/test/material/button_bar_test.dart +++ b/packages/flutter/test/material/button_bar_test.dart @@ -631,8 +631,8 @@ void main() { testWidgets('_RenderButtonBarRow.constraints does not work before layout', (WidgetTester tester) async { await tester.pumpWidget( const MaterialApp(home: ButtonBar()), - Duration.zero, - EnginePhase.build, + duration: Duration.zero, + phase: EnginePhase.build, ); final Finder buttonBar = find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_ButtonBarRow'); diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 6e43672535..2a5b97662f 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -6570,8 +6570,7 @@ testWidgets('OutlineInputBorder with BorderRadius.zero should draw a rectangular ), ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); } finally { FlutterError.onError = oldHandler; diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index b74a1064da..d1aab5b508 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -441,8 +441,7 @@ void main() { await tester.pumpWidget( buildFrame(const EdgeInsets.only(bottom: 400)), - null, - EnginePhase.build, + phase: EnginePhase.build, ); expect(renderBox.debugNeedsLayout, true); diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 74d8ec8e56..9ae0c2676d 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -306,7 +306,7 @@ void main() { indicatorPadding: indicatorPadding + const EdgeInsets.all(7.0), ), ), - ), Duration.zero, EnginePhase.build); + ), duration: Duration.zero, phase: EnginePhase.build); expect(tester.renderObject(find.byType(CustomPaint)).debugNeedsPaint, true); }); diff --git a/packages/flutter/test/rendering/non_normalized_constraints_test.dart b/packages/flutter/test/rendering/non_normalized_constraints_test.dart index ecd69ce15c..3a3671264b 100644 --- a/packages/flutter/test/rendering/non_normalized_constraints_test.dart +++ b/packages/flutter/test/rendering/non_normalized_constraints_test.dart @@ -32,7 +32,7 @@ class Foo extends SingleChildRenderObjectWidget { void main() { testWidgets('Stack parsing in non-normalized constraints error', (WidgetTester tester) async { - await tester.pumpWidget(const Foo(child: Placeholder()), Duration.zero, EnginePhase.layout); + await tester.pumpWidget(const Foo(child: Placeholder()), duration: Duration.zero, phase: EnginePhase.layout); final Object? exception = tester.takeException(); final String text = exception.toString(); expect(text, contains('BoxConstraints has non-normalized width constraints.')); diff --git a/packages/flutter/test/semantics/semantics_update_test.dart b/packages/flutter/test/semantics/semantics_update_test.dart index 546ad5f646..69383b7b3c 100644 --- a/packages/flutter/test/semantics/semantics_update_test.dart +++ b/packages/flutter/test/semantics/semantics_update_test.dart @@ -18,8 +18,7 @@ void main() { await tester.pumpWidget( const Placeholder(), // Stops right after the warm up frame. - null, - EnginePhase.build, + phase: EnginePhase.build, ); // The warm up frame will send update for an empty semantics tree. We // ignore this one time update. @@ -91,8 +90,7 @@ void main() { await tester.pumpWidget( const Placeholder(), // Stops right after the warm up frame. - null, - EnginePhase.build, + phase: EnginePhase.build, ); // The warm up frame will send update for an empty semantics tree. We // ignore this one time update. diff --git a/packages/flutter/test/widgets/animated_size_test.dart b/packages/flutter/test/widgets/animated_size_test.dart index 54927edf3c..c36494af1a 100644 --- a/packages/flutter/test/widgets/animated_size_test.dart +++ b/packages/flutter/test/widgets/animated_size_test.dart @@ -378,7 +378,7 @@ void main() { ), ), ), - duration, + duration: duration, ); } diff --git a/packages/flutter/test/widgets/async_test.dart b/packages/flutter/test/widgets/async_test.dart index 9c68541206..2a01e23ed7 100644 --- a/packages/flutter/test/widgets/async_test.dart +++ b/packages/flutter/test/widgets/async_test.dart @@ -202,7 +202,7 @@ void main() { await tester.pumpWidget(FutureBuilder( future: completer.future, builder: snapshotText, - ), const Duration(seconds: 1)); + ), duration: const Duration(seconds: 1)); completer.completeError('bad'); }, (Object error, StackTrace stack) { expectSync(error, equals('bad')); diff --git a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart index 52e8dd1b4a..4a47b897f4 100644 --- a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart +++ b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart @@ -1248,7 +1248,7 @@ void main() { ), ], ), - ), null, EnginePhase.build); + ), phase: EnginePhase.build); expect(tester.takeException(), isAssertionError); }); diff --git a/packages/flutter/test/widgets/flex_test.dart b/packages/flutter/test/widgets/flex_test.dart index 1a29b997e2..fed96741a7 100644 --- a/packages/flutter/test/widgets/flex_test.dart +++ b/packages/flutter/test/widgets/flex_test.dart @@ -109,8 +109,8 @@ void main() { Column(), ], ), - Duration.zero, - EnginePhase.layout, + duration: Duration.zero, + phase: EnginePhase.layout, ); // Turn off intrinsics checking, which also fails with the same exception. @@ -125,8 +125,8 @@ void main() { ), ], ), - Duration.zero, - EnginePhase.layout, + duration: Duration.zero, + phase: EnginePhase.layout, ); debugCheckIntrinsicSizes = true; final String message = tester.takeException().toString(); diff --git a/packages/flutter/test/widgets/image_resolution_test.dart b/packages/flutter/test/widgets/image_resolution_test.dart index 44cbd04fe4..d2ad58ab08 100644 --- a/packages/flutter/test/widgets/image_resolution_test.dart +++ b/packages/flutter/test/widgets/image_resolution_test.dart @@ -146,9 +146,7 @@ RenderImage getRenderImage(WidgetTester tester, Key key) { } Future pumpTreeToLayout(WidgetTester tester, Widget widget) { - const Duration pumpDuration = Duration.zero; - const EnginePhase pumpPhase = EnginePhase.layout; - return tester.pumpWidget(widget, pumpDuration, pumpPhase); + return tester.pumpWidget(widget, duration: Duration.zero, phase: EnginePhase.layout); } void main() { diff --git a/packages/flutter/test/widgets/image_rtl_test.dart b/packages/flutter/test/widgets/image_rtl_test.dart index d85267850b..94a19b837b 100644 --- a/packages/flutter/test/widgets/image_rtl_test.dart +++ b/packages/flutter/test/widgets/image_rtl_test.dart @@ -56,8 +56,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(Container), paints ..clipRect(rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 50.0)) @@ -95,8 +95,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(Container), paints ..clipRect(rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 50.0)) @@ -130,8 +130,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(Container), paints ..clipRect(rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 50.0)) @@ -165,8 +165,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(Container), paints ..clipRect(rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 50.0)) @@ -200,8 +200,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(Container), paints ..translate(x: 50.0, y: 0.0) @@ -231,8 +231,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(Container), paints ..drawImageRect(source: const Rect.fromLTRB(0.0, 0.0, 16.0, 9.0), destination: const Rect.fromLTRB(84.0, 20.5, 100.0, 29.5)), @@ -259,8 +259,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(Container), paints ..drawImageRect(source: const Rect.fromLTRB(0.0, 0.0, 16.0, 9.0), destination: const Rect.fromLTRB(84.0, 20.5, 100.0, 29.5)), @@ -287,8 +287,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(Container), paints ..drawImageRect(source: const Rect.fromLTRB(0.0, 0.0, 16.0, 9.0), destination: const Rect.fromLTRB(84.0, 20.5, 100.0, 29.5)), @@ -314,8 +314,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(SizedBox), paints ..clipRect(rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 50.0)) @@ -351,8 +351,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(SizedBox), paints ..clipRect(rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 50.0)) @@ -384,8 +384,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(SizedBox), paints ..clipRect(rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 50.0)) @@ -417,8 +417,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(SizedBox), paints ..clipRect(rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 50.0)) @@ -477,8 +477,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(SizedBox), paints ..drawImageRect(source: const Rect.fromLTRB(0.0, 0.0, 16.0, 9.0), destination: const Rect.fromLTRB(84.0, 20.5, 100.0, 29.5)), @@ -503,8 +503,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(SizedBox), paints ..drawImageRect(source: const Rect.fromLTRB(0.0, 0.0, 16.0, 9.0), destination: const Rect.fromLTRB(84.0, 20.5, 100.0, 29.5)), @@ -529,8 +529,8 @@ void main() { ), ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); expect(find.byType(SizedBox), paints ..drawImageRect(source: const Rect.fromLTRB(0.0, 0.0, 16.0, 9.0), destination: const Rect.fromLTRB(84.0, 20.5, 100.0, 29.5)), @@ -548,8 +548,8 @@ void main() { alignment: Alignment.centerRight, ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); await tester.pumpWidget( Directionality( @@ -560,8 +560,8 @@ void main() { matchTextDirection: true, ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); await tester.pumpWidget( Directionality( @@ -571,8 +571,8 @@ void main() { alignment: Alignment.centerRight, ), ), - Duration.zero, - EnginePhase.layout, // so that we don't try to paint the fake images + duration: Duration.zero, + phase: EnginePhase.layout, // so that we don't try to paint the fake images ); }); } diff --git a/packages/flutter/test/widgets/image_test.dart b/packages/flutter/test/widgets/image_test.dart index 801766ad23..65c50e12c1 100644 --- a/packages/flutter/test/widgets/image_test.dart +++ b/packages/flutter/test/widgets/image_test.dart @@ -97,8 +97,7 @@ void main() { excludeFromSemantics: true, ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); @@ -119,8 +118,7 @@ void main() { excludeFromSemantics: true, ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; @@ -139,8 +137,7 @@ void main() { excludeFromSemantics: true, ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); @@ -162,8 +159,7 @@ void main() { excludeFromSemantics: true, ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; @@ -179,8 +175,7 @@ void main() { image: imageProvider1, excludeFromSemantics: true, ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); @@ -199,8 +194,7 @@ void main() { image: imageProvider2, excludeFromSemantics: true, ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; @@ -217,8 +211,7 @@ void main() { image: imageProvider1, excludeFromSemantics: true, ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); @@ -238,8 +231,7 @@ void main() { excludeFromSemantics: true, image: imageProvider2, ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; @@ -927,8 +919,7 @@ void main() { image: imageProvider1, ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); RenderImage renderImage = key.currentContext!.findRenderObject()! as RenderImage; expect(renderImage.image, isNull); @@ -951,8 +942,7 @@ void main() { image: imageProvider2, ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); renderImage = key.currentContext!.findRenderObject()! as RenderImage; @@ -965,10 +955,10 @@ void main() { final Image image2 = Image(image: _TestImageProvider()..complete(image10x10.clone()), width: 20.0, excludeFromSemantics: true); final Column column = Column(children: [image1, image2]); - await tester.pumpWidget(column, null, EnginePhase.layout); + await tester.pumpWidget(column, phase:EnginePhase.layout); final Column columnSwapped = Column(children: [image2, image1]); - await tester.pumpWidget(columnSwapped, null, EnginePhase.layout); + await tester.pumpWidget(columnSwapped, phase: EnginePhase.layout); final List renderObjects = tester.renderObjectList(find.byType(Image)).toList(); expect(renderObjects, hasLength(2)); @@ -1420,8 +1410,7 @@ void main() { excludeFromSemantics: true, ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); // only listener from resolveStreamForKey is left. @@ -1454,8 +1443,7 @@ void main() { excludeFromSemantics: true, ), ), - null, - EnginePhase.layout, + phase: EnginePhase.layout, ); // only listener from resolveStreamForKey is left. diff --git a/packages/flutter/test/widgets/list_view_horizontal_test.dart b/packages/flutter/test/widgets/list_view_horizontal_test.dart index 26b0533da0..abfe4fc8c7 100644 --- a/packages/flutter/test/widgets/list_view_horizontal_test.dart +++ b/packages/flutter/test/widgets/list_view_horizontal_test.dart @@ -117,7 +117,7 @@ void main() { expect(find.text('5'), findsOneWidget); await tester.pumpWidget(Container()); - await tester.pumpWidget(buildFrame(textDirection: TextDirection.ltr), const Duration(seconds: 1)); + await tester.pumpWidget(buildFrame(textDirection: TextDirection.ltr), duration: const Duration(seconds: 1)); await tester.drag(find.text('2'), const Offset(-280.0, 0.0), touchSlopX: 0.0); await tester.pump(const Duration(seconds: 1)); // screen is 800px wide, and has the following items: @@ -436,7 +436,7 @@ void main() { expect(find.text('5'), findsOneWidget); await tester.pumpWidget(Container()); - await tester.pumpWidget(buildFrame(reverse: true, textDirection: TextDirection.rtl), const Duration(seconds: 1)); + await tester.pumpWidget(buildFrame(reverse: true, textDirection: TextDirection.rtl), duration: const Duration(seconds: 1)); await tester.drag(find.text('2'), const Offset(-280.0, 0.0), touchSlopX: 0.0); await tester.pump(const Duration(seconds: 1)); // screen is 800px wide, and has the following items: diff --git a/packages/flutter/test/widgets/nested_scroll_view_test.dart b/packages/flutter/test/widgets/nested_scroll_view_test.dart index a18a5d9dd1..fbf84f5188 100644 --- a/packages/flutter/test/widgets/nested_scroll_view_test.dart +++ b/packages/flutter/test/widgets/nested_scroll_view_test.dart @@ -2664,7 +2664,7 @@ void main() { ), ); - await tester.pumpWidget(myApp, Duration.zero, EnginePhase.build); + await tester.pumpWidget(myApp, duration: Duration.zero, phase: EnginePhase.build); expect(isScrolled, false); expect(tester.takeException(), isNull); }); diff --git a/packages/flutter/test/widgets/scroll_controller_test.dart b/packages/flutter/test/widgets/scroll_controller_test.dart index eeadbc0f65..33b0d1a847 100644 --- a/packages/flutter/test/widgets/scroll_controller_test.dart +++ b/packages/flutter/test/widgets/scroll_controller_test.dart @@ -199,7 +199,7 @@ void main() { await tester.pump(); // Start the animation. // We will now change the tree on the same frame as the animation ends. - await tester.pumpWidget(Container(), const Duration(seconds: 2)); + await tester.pumpWidget(Container(), duration: const Duration(seconds: 2)); }); testWidgets('Read operations on ScrollControllers with no positions fail', (WidgetTester tester) async { diff --git a/packages/flutter/test/widgets/table_test.dart b/packages/flutter/test/widgets/table_test.dart index 50eac0e575..69cc2cc720 100644 --- a/packages/flutter/test/widgets/table_test.dart +++ b/packages/flutter/test/widgets/table_test.dart @@ -1023,7 +1023,7 @@ void main() { await tester.pumpWidget( buildTable(const ValueKey(1)), - null, EnginePhase.build, // Children are not laid out! + phase: EnginePhase.build, // Children are not laid out! ); await tester.pumpWidget( diff --git a/packages/flutter_test/lib/src/widget_tester.dart b/packages/flutter_test/lib/src/widget_tester.dart index 75219df01b..7d8799cda5 100644 --- a/packages/flutter_test/lib/src/widget_tester.dart +++ b/packages/flutter_test/lib/src/widget_tester.dart @@ -584,10 +584,10 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker /// See also [LiveTestWidgetsFlutterBindingFramePolicy], which affects how /// this method works when the test is run with `flutter run`. Future pumpWidget( - Widget widget, [ + Widget widget, { Duration? duration, EnginePhase phase = EnginePhase.sendSemanticsUpdate, - ]) { + }) { return TestAsyncUtils.guard(() { binding.attachRootWidget(binding.wrapWithDefaultView(widget)); binding.scheduleFrame(); diff --git a/packages/flutter_test/test/widget_tester_leaks_test.dart b/packages/flutter_test/test/widget_tester_leaks_test.dart index 13012d8fe7..0f9384b9ec 100644 --- a/packages/flutter_test/test/widget_tester_leaks_test.dart +++ b/packages/flutter_test/test/widget_tester_leaks_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; @@ -48,7 +49,7 @@ void main() { _testExecutions.add(execution); testWidgets(execution.name, experimentalLeakTesting: settings, (WidgetTester tester) async { - await test.body(tester.pumpWidget, tester.runAsync); + await test.body((Widget widget, [Duration? duration]) => tester.pumpWidget(widget, duration: duration), tester.runAsync); }); } }