@@ -111,7 +111,7 @@ void main() {
111
111
expect (materialWidget.color, customColor);
112
112
});
113
113
114
- testWidgets ('Dialog Defaults' , (WidgetTester tester) async {
114
+ testWidgetsWithLeakTracking ('Dialog Defaults' , (WidgetTester tester) async {
115
115
const AlertDialog dialog = AlertDialog (
116
116
title: Text ('Title' ),
117
117
content: Text ('Y' ),
@@ -146,7 +146,7 @@ void main() {
146
146
expect (material3Widget.elevation, 6.0 );
147
147
});
148
148
149
- testWidgets ('Dialog.fullscreen Defaults' , (WidgetTester tester) async {
149
+ testWidgetsWithLeakTracking ('Dialog.fullscreen Defaults' , (WidgetTester tester) async {
150
150
const String dialogTextM2 = 'Fullscreen Dialog - M2' ;
151
151
const String dialogTextM3 = 'Fullscreen Dialog - M3' ;
152
152
@@ -447,7 +447,7 @@ void main() {
447
447
expect (textRect.bottom, dialogRect.bottom - customPadding.bottom);
448
448
});
449
449
450
- testWidgets ('Barrier dismissible' , (WidgetTester tester) async {
450
+ testWidgetsWithLeakTracking ('Barrier dismissible' , (WidgetTester tester) async {
451
451
await tester.pumpWidget (
452
452
const MaterialApp (
453
453
home: Material (
@@ -644,7 +644,7 @@ void main() {
644
644
expect (actionsSize.width, dialogSize.width - (30.0 * 2 ));
645
645
});
646
646
647
- testWidgets ('AlertDialog.buttonPadding defaults' , (WidgetTester tester) async {
647
+ testWidgetsWithLeakTracking ('AlertDialog.buttonPadding defaults' , (WidgetTester tester) async {
648
648
final GlobalKey key1 = GlobalKey ();
649
649
final GlobalKey key2 = GlobalKey ();
650
650
@@ -1904,7 +1904,7 @@ void main() {
1904
1904
semantics.dispose ();
1905
1905
});
1906
1906
1907
- testWidgets ('Dismissible.confirmDismiss defers to an AlertDialog' , (WidgetTester tester) async {
1907
+ testWidgetsWithLeakTracking ('Dismissible.confirmDismiss defers to an AlertDialog' , (WidgetTester tester) async {
1908
1908
final GlobalKey <ScaffoldState > scaffoldKey = GlobalKey <ScaffoldState >();
1909
1909
final List <int > dismissedItems = < int > [];
1910
1910
@@ -2035,7 +2035,7 @@ void main() {
2035
2035
});
2036
2036
2037
2037
// Regression test for https://github.com/flutter/flutter/issues/28505.
2038
- testWidgets ('showDialog only gets Theme from context on the first call' , (WidgetTester tester) async {
2038
+ testWidgetsWithLeakTracking ('showDialog only gets Theme from context on the first call' , (WidgetTester tester) async {
2039
2039
Widget buildFrame (Key builderKey) {
2040
2040
return MaterialApp (
2041
2041
home: Center (
@@ -2072,7 +2072,7 @@ void main() {
2072
2072
await tester.pump ();
2073
2073
});
2074
2074
2075
- testWidgets ('showDialog safe area' , (WidgetTester tester) async {
2075
+ testWidgetsWithLeakTracking ('showDialog safe area' , (WidgetTester tester) async {
2076
2076
await tester.pumpWidget (
2077
2077
MaterialApp (
2078
2078
builder: (BuildContext context, Widget ? child) {
@@ -2337,7 +2337,7 @@ void main() {
2337
2337
});
2338
2338
2339
2339
group ('AlertDialog.scrollable: ' , () {
2340
- testWidgets ('Title is scrollable' , (WidgetTester tester) async {
2340
+ testWidgetsWithLeakTracking ('Title is scrollable' , (WidgetTester tester) async {
2341
2341
final Key titleKey = UniqueKey ();
2342
2342
final AlertDialog dialog = AlertDialog (
2343
2343
title: Container (
@@ -2377,7 +2377,7 @@ void main() {
2377
2377
expect (box.localToGlobal (Offset .zero), equals (originalOffset.translate (0.0 , - 200.0 )));
2378
2378
});
2379
2379
2380
- testWidgets ('Title and content are scrollable' , (WidgetTester tester) async {
2380
+ testWidgetsWithLeakTracking ('Title and content are scrollable' , (WidgetTester tester) async {
2381
2381
final Key titleKey = UniqueKey ();
2382
2382
final Key contentKey = UniqueKey ();
2383
2383
final AlertDialog dialog = AlertDialog (
@@ -2416,7 +2416,7 @@ void main() {
2416
2416
});
2417
2417
});
2418
2418
2419
- testWidgets ('Dialog with RouteSettings' , (WidgetTester tester) async {
2419
+ testWidgetsWithLeakTracking ('Dialog with RouteSettings' , (WidgetTester tester) async {
2420
2420
late RouteSettings currentRouteSetting;
2421
2421
2422
2422
await tester.pumpWidget (
@@ -2510,7 +2510,7 @@ void main() {
2510
2510
semantics.dispose ();
2511
2511
});
2512
2512
2513
- testWidgets ('DialogRoute is state restorable' , (WidgetTester tester) async {
2513
+ testWidgetsWithLeakTracking ('DialogRoute is state restorable' , (WidgetTester tester) async {
2514
2514
await tester.pumpWidget (
2515
2515
const MaterialApp (
2516
2516
restorationScopeId: 'app' ,
@@ -2706,7 +2706,7 @@ void main() {
2706
2706
}
2707
2707
});
2708
2708
2709
- testWidgets ('showAdaptiveDialog should not allow dismiss on barrier on iOS by default' , (WidgetTester tester) async {
2709
+ testWidgetsWithLeakTracking ('showAdaptiveDialog should not allow dismiss on barrier on iOS by default' , (WidgetTester tester) async {
2710
2710
await tester.pumpWidget (
2711
2711
MaterialApp (
2712
2712
theme: ThemeData (platform: TargetPlatform .iOS),
@@ -2766,9 +2766,11 @@ void main() {
2766
2766
expect (find.text ('Dialog2' ), findsOneWidget);
2767
2767
});
2768
2768
2769
- testWidgets ('Uses open focus traversal when overridden' , (WidgetTester tester) async {
2769
+ testWidgetsWithLeakTracking ('Uses open focus traversal when overridden' , (WidgetTester tester) async {
2770
2770
final FocusNode okNode = FocusNode ();
2771
+ addTearDown (okNode.dispose);
2771
2772
final FocusNode cancelNode = FocusNode ();
2773
+ addTearDown (cancelNode.dispose);
2772
2774
2773
2775
Future <bool > nextFocus () async {
2774
2776
final bool result = Actions .invoke (
0 commit comments