@@ -6,6 +6,8 @@ import 'package:flutter/foundation.dart';
6
6
import 'package:flutter/material.dart' ;
7
7
import 'package:flutter_test/flutter_test.dart' ;
8
8
9
+ import '../foundation/leak_tracking.dart' ;
10
+
9
11
void main () {
10
12
testWidgets ('BackButton control test' , (WidgetTester tester) async {
11
13
await tester.pumpWidget (
@@ -34,7 +36,7 @@ void main() {
34
36
expect (find.text ('Home' ), findsOneWidget);
35
37
});
36
38
37
- testWidgets ('BackButton onPressed overrides default pop behavior' , (WidgetTester tester) async {
39
+ testWidgetsWithLeakTracking ('BackButton onPressed overrides default pop behavior' , (WidgetTester tester) async {
38
40
bool customCallbackWasCalled = false ;
39
41
await tester.pumpWidget (
40
42
MaterialApp (
@@ -67,7 +69,7 @@ void main() {
67
69
expect (customCallbackWasCalled, true );
68
70
});
69
71
70
- testWidgets ('BackButton icon' , (WidgetTester tester) async {
72
+ testWidgetsWithLeakTracking ('BackButton icon' , (WidgetTester tester) async {
71
73
final Key androidKey = UniqueKey ();
72
74
final Key iOSKey = UniqueKey ();
73
75
final Key linuxKey = UniqueKey ();
@@ -115,7 +117,7 @@ void main() {
115
117
expect (windowsIcon.icon == androidIcon.icon, isTrue);
116
118
});
117
119
118
- testWidgets ('BackButton color' , (WidgetTester tester) async {
120
+ testWidgetsWithLeakTracking ('BackButton color' , (WidgetTester tester) async {
119
121
await tester.pumpWidget (
120
122
const MaterialApp (
121
123
home: Material (
@@ -133,7 +135,7 @@ void main() {
133
135
expect (iconText.text.style! .color, Colors .red);
134
136
});
135
137
136
- testWidgets ('BackButton color with ButtonStyle' , (WidgetTester tester) async {
138
+ testWidgetsWithLeakTracking ('BackButton color with ButtonStyle' , (WidgetTester tester) async {
137
139
await tester.pumpWidget (
138
140
MaterialApp (
139
141
theme: ThemeData (useMaterial3: true ),
@@ -154,7 +156,7 @@ void main() {
154
156
expect (iconText.text.style! .color, Colors .red);
155
157
});
156
158
157
- testWidgets ('BackButton.style.iconColor parameter overrides BackButton.color' , (WidgetTester tester) async {
159
+ testWidgetsWithLeakTracking ('BackButton.style.iconColor parameter overrides BackButton.color' , (WidgetTester tester) async {
158
160
await tester.pumpWidget (
159
161
MaterialApp (
160
162
theme: ThemeData (useMaterial3: true ),
@@ -177,7 +179,7 @@ void main() {
177
179
expect (iconText.text.style! .color, Colors .red);
178
180
});
179
181
180
- testWidgets ('BackButton semantics' , (WidgetTester tester) async {
182
+ testWidgetsWithLeakTracking ('BackButton semantics' , (WidgetTester tester) async {
181
183
final SemanticsHandle handle = tester.ensureSemantics ();
182
184
await tester.pumpWidget (
183
185
MaterialApp (
@@ -220,7 +222,7 @@ void main() {
220
222
handle.dispose ();
221
223
}, variant: TargetPlatformVariant .all ());
222
224
223
- testWidgets ('CloseButton semantics' , (WidgetTester tester) async {
225
+ testWidgetsWithLeakTracking ('CloseButton semantics' , (WidgetTester tester) async {
224
226
final SemanticsHandle handle = tester.ensureSemantics ();
225
227
await tester.pumpWidget (
226
228
MaterialApp (
@@ -263,7 +265,7 @@ void main() {
263
265
handle.dispose ();
264
266
}, variant: TargetPlatformVariant .all ());
265
267
266
- testWidgets ('CloseButton color' , (WidgetTester tester) async {
268
+ testWidgetsWithLeakTracking ('CloseButton color' , (WidgetTester tester) async {
267
269
await tester.pumpWidget (
268
270
const MaterialApp (
269
271
home: Material (
@@ -281,7 +283,7 @@ void main() {
281
283
expect (iconText.text.style! .color, Colors .red);
282
284
});
283
285
284
- testWidgets ('CloseButton color with ButtonStyle' , (WidgetTester tester) async {
286
+ testWidgetsWithLeakTracking ('CloseButton color with ButtonStyle' , (WidgetTester tester) async {
285
287
await tester.pumpWidget (
286
288
MaterialApp (
287
289
theme: ThemeData (useMaterial3: true ),
@@ -302,7 +304,7 @@ void main() {
302
304
expect (iconText.text.style! .color, Colors .red);
303
305
});
304
306
305
- testWidgets ('CloseButton.style.iconColor parameter overrides CloseButton.color' , (WidgetTester tester) async {
307
+ testWidgetsWithLeakTracking ('CloseButton.style.iconColor parameter overrides CloseButton.color' , (WidgetTester tester) async {
306
308
await tester.pumpWidget (
307
309
MaterialApp (
308
310
theme: ThemeData (useMaterial3: true ),
@@ -325,7 +327,7 @@ void main() {
325
327
expect (iconText.text.style! .color, Colors .red);
326
328
});
327
329
328
- testWidgets ('CloseButton onPressed overrides default pop behavior' , (WidgetTester tester) async {
330
+ testWidgetsWithLeakTracking ('CloseButton onPressed overrides default pop behavior' , (WidgetTester tester) async {
329
331
bool customCallbackWasCalled = false ;
330
332
await tester.pumpWidget (
331
333
MaterialApp (
0 commit comments