9
9
10
10
import 'package:flutter/material.dart' ;
11
11
import 'package:flutter_test/flutter_test.dart' ;
12
+ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart' ;
12
13
13
14
void main () {
14
15
test ('CardTheme copyWith, ==, hashCode basics' , () {
@@ -22,7 +23,7 @@ void main() {
22
23
expect (identical (CardTheme .lerp (theme, theme, 0.5 ), theme), true );
23
24
});
24
25
25
- testWidgets ('Material3 - Passing no CardTheme returns defaults' , (WidgetTester tester) async {
26
+ testWidgetsWithLeakTracking ('Material3 - Passing no CardTheme returns defaults' , (WidgetTester tester) async {
26
27
final ThemeData theme = ThemeData (useMaterial3: true );
27
28
await tester.pumpWidget (MaterialApp (
28
29
theme: theme,
@@ -45,7 +46,7 @@ void main() {
45
46
));
46
47
});
47
48
48
- testWidgets ('Card uses values from CardTheme' , (WidgetTester tester) async {
49
+ testWidgetsWithLeakTracking ('Card uses values from CardTheme' , (WidgetTester tester) async {
49
50
final CardTheme cardTheme = _cardTheme ();
50
51
51
52
await tester.pumpWidget (MaterialApp (
@@ -67,7 +68,7 @@ void main() {
67
68
expect (material.shape, cardTheme.shape);
68
69
});
69
70
70
- testWidgets ('Card widget properties take priority over theme' , (WidgetTester tester) async {
71
+ testWidgetsWithLeakTracking ('Card widget properties take priority over theme' , (WidgetTester tester) async {
71
72
const Clip clip = Clip .hardEdge;
72
73
const Color color = Colors .orange;
73
74
const Color shadowColor = Colors .pink;
@@ -102,7 +103,7 @@ void main() {
102
103
expect (material.shape, shape);
103
104
});
104
105
105
- testWidgets ('CardTheme properties take priority over ThemeData properties' , (WidgetTester tester) async {
106
+ testWidgetsWithLeakTracking ('CardTheme properties take priority over ThemeData properties' , (WidgetTester tester) async {
106
107
final CardTheme cardTheme = _cardTheme ();
107
108
final ThemeData themeData = _themeData ().copyWith (cardTheme: cardTheme);
108
109
@@ -117,7 +118,7 @@ void main() {
117
118
expect (material.color, cardTheme.color);
118
119
});
119
120
120
- testWidgets ('Material3 - ThemeData properties are used when no CardTheme is set' , (WidgetTester tester) async {
121
+ testWidgetsWithLeakTracking ('Material3 - ThemeData properties are used when no CardTheme is set' , (WidgetTester tester) async {
121
122
final ThemeData themeData = ThemeData (useMaterial3: true );
122
123
123
124
await tester.pumpWidget (MaterialApp (
@@ -131,7 +132,7 @@ void main() {
131
132
expect (material.color, themeData.colorScheme.surface);
132
133
});
133
134
134
- testWidgets ('Material3 - CardTheme customizes shape' , (WidgetTester tester) async {
135
+ testWidgetsWithLeakTracking ('Material3 - CardTheme customizes shape' , (WidgetTester tester) async {
135
136
const CardTheme cardTheme = CardTheme (
136
137
color: Colors .white,
137
138
shape: BeveledRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (7 ))),
@@ -165,7 +166,7 @@ void main() {
165
166
// support is deprecated and the APIs are removed, these tests
166
167
// can be deleted.
167
168
168
- testWidgets ('Material2 - ThemeData properties are used when no CardTheme is set' , (WidgetTester tester) async {
169
+ testWidgetsWithLeakTracking ('Material2 - ThemeData properties are used when no CardTheme is set' , (WidgetTester tester) async {
169
170
final ThemeData themeData = ThemeData (useMaterial3: false );
170
171
171
172
await tester.pumpWidget (MaterialApp (
@@ -179,7 +180,7 @@ void main() {
179
180
expect (material.color, themeData.cardColor);
180
181
});
181
182
182
- testWidgets ('Material2 - Passing no CardTheme returns defaults' , (WidgetTester tester) async {
183
+ testWidgetsWithLeakTracking ('Material2 - Passing no CardTheme returns defaults' , (WidgetTester tester) async {
183
184
await tester.pumpWidget (MaterialApp (
184
185
theme: ThemeData (useMaterial3: false ),
185
186
home: const Scaffold (
@@ -201,7 +202,7 @@ void main() {
201
202
));
202
203
});
203
204
204
- testWidgets ('Material2 - CardTheme customizes shape' , (WidgetTester tester) async {
205
+ testWidgetsWithLeakTracking ('Material2 - CardTheme customizes shape' , (WidgetTester tester) async {
205
206
const CardTheme cardTheme = CardTheme (
206
207
color: Colors .white,
207
208
shape: BeveledRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (7 ))),
0 commit comments