@@ -6,6 +6,8 @@ import 'package:flutter/foundation.dart';
66import 'package:flutter/material.dart' ;
77import 'package:flutter_test/flutter_test.dart' ;
88
9+ import '../foundation/leak_tracking.dart' ;
10+
911void main () {
1012 testWidgets ('BackButton control test' , (WidgetTester tester) async {
1113 await tester.pumpWidget (
@@ -34,7 +36,7 @@ void main() {
3436 expect (find.text ('Home' ), findsOneWidget);
3537 });
3638
37- testWidgets ('BackButton onPressed overrides default pop behavior' , (WidgetTester tester) async {
39+ testWidgetsWithLeakTracking ('BackButton onPressed overrides default pop behavior' , (WidgetTester tester) async {
3840 bool customCallbackWasCalled = false ;
3941 await tester.pumpWidget (
4042 MaterialApp (
@@ -67,7 +69,7 @@ void main() {
6769 expect (customCallbackWasCalled, true );
6870 });
6971
70- testWidgets ('BackButton icon' , (WidgetTester tester) async {
72+ testWidgetsWithLeakTracking ('BackButton icon' , (WidgetTester tester) async {
7173 final Key androidKey = UniqueKey ();
7274 final Key iOSKey = UniqueKey ();
7375 final Key linuxKey = UniqueKey ();
@@ -115,7 +117,7 @@ void main() {
115117 expect (windowsIcon.icon == androidIcon.icon, isTrue);
116118 });
117119
118- testWidgets ('BackButton color' , (WidgetTester tester) async {
120+ testWidgetsWithLeakTracking ('BackButton color' , (WidgetTester tester) async {
119121 await tester.pumpWidget (
120122 const MaterialApp (
121123 home: Material (
@@ -133,7 +135,7 @@ void main() {
133135 expect (iconText.text.style! .color, Colors .red);
134136 });
135137
136- testWidgets ('BackButton color with ButtonStyle' , (WidgetTester tester) async {
138+ testWidgetsWithLeakTracking ('BackButton color with ButtonStyle' , (WidgetTester tester) async {
137139 await tester.pumpWidget (
138140 MaterialApp (
139141 theme: ThemeData (useMaterial3: true ),
@@ -154,7 +156,7 @@ void main() {
154156 expect (iconText.text.style! .color, Colors .red);
155157 });
156158
157- testWidgets ('BackButton.style.iconColor parameter overrides BackButton.color' , (WidgetTester tester) async {
159+ testWidgetsWithLeakTracking ('BackButton.style.iconColor parameter overrides BackButton.color' , (WidgetTester tester) async {
158160 await tester.pumpWidget (
159161 MaterialApp (
160162 theme: ThemeData (useMaterial3: true ),
@@ -177,7 +179,7 @@ void main() {
177179 expect (iconText.text.style! .color, Colors .red);
178180 });
179181
180- testWidgets ('BackButton semantics' , (WidgetTester tester) async {
182+ testWidgetsWithLeakTracking ('BackButton semantics' , (WidgetTester tester) async {
181183 final SemanticsHandle handle = tester.ensureSemantics ();
182184 await tester.pumpWidget (
183185 MaterialApp (
@@ -220,7 +222,7 @@ void main() {
220222 handle.dispose ();
221223 }, variant: TargetPlatformVariant .all ());
222224
223- testWidgets ('CloseButton semantics' , (WidgetTester tester) async {
225+ testWidgetsWithLeakTracking ('CloseButton semantics' , (WidgetTester tester) async {
224226 final SemanticsHandle handle = tester.ensureSemantics ();
225227 await tester.pumpWidget (
226228 MaterialApp (
@@ -263,7 +265,7 @@ void main() {
263265 handle.dispose ();
264266 }, variant: TargetPlatformVariant .all ());
265267
266- testWidgets ('CloseButton color' , (WidgetTester tester) async {
268+ testWidgetsWithLeakTracking ('CloseButton color' , (WidgetTester tester) async {
267269 await tester.pumpWidget (
268270 const MaterialApp (
269271 home: Material (
@@ -281,7 +283,7 @@ void main() {
281283 expect (iconText.text.style! .color, Colors .red);
282284 });
283285
284- testWidgets ('CloseButton color with ButtonStyle' , (WidgetTester tester) async {
286+ testWidgetsWithLeakTracking ('CloseButton color with ButtonStyle' , (WidgetTester tester) async {
285287 await tester.pumpWidget (
286288 MaterialApp (
287289 theme: ThemeData (useMaterial3: true ),
@@ -302,7 +304,7 @@ void main() {
302304 expect (iconText.text.style! .color, Colors .red);
303305 });
304306
305- testWidgets ('CloseButton.style.iconColor parameter overrides CloseButton.color' , (WidgetTester tester) async {
307+ testWidgetsWithLeakTracking ('CloseButton.style.iconColor parameter overrides CloseButton.color' , (WidgetTester tester) async {
306308 await tester.pumpWidget (
307309 MaterialApp (
308310 theme: ThemeData (useMaterial3: true ),
@@ -325,7 +327,7 @@ void main() {
325327 expect (iconText.text.style! .color, Colors .red);
326328 });
327329
328- testWidgets ('CloseButton onPressed overrides default pop behavior' , (WidgetTester tester) async {
330+ testWidgetsWithLeakTracking ('CloseButton onPressed overrides default pop behavior' , (WidgetTester tester) async {
329331 bool customCallbackWasCalled = false ;
330332 await tester.pumpWidget (
331333 MaterialApp (
0 commit comments