99
1010import 'package:flutter/material.dart' ;
1111import 'package:flutter_test/flutter_test.dart' ;
12+ import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart' ;
1213
1314void main () {
1415 test ('CardTheme copyWith, ==, hashCode basics' , () {
@@ -22,7 +23,7 @@ void main() {
2223 expect (identical (CardTheme .lerp (theme, theme, 0.5 ), theme), true );
2324 });
2425
25- testWidgets ('Material3 - Passing no CardTheme returns defaults' , (WidgetTester tester) async {
26+ testWidgetsWithLeakTracking ('Material3 - Passing no CardTheme returns defaults' , (WidgetTester tester) async {
2627 final ThemeData theme = ThemeData (useMaterial3: true );
2728 await tester.pumpWidget (MaterialApp (
2829 theme: theme,
@@ -45,7 +46,7 @@ void main() {
4546 ));
4647 });
4748
48- testWidgets ('Card uses values from CardTheme' , (WidgetTester tester) async {
49+ testWidgetsWithLeakTracking ('Card uses values from CardTheme' , (WidgetTester tester) async {
4950 final CardTheme cardTheme = _cardTheme ();
5051
5152 await tester.pumpWidget (MaterialApp (
@@ -67,7 +68,7 @@ void main() {
6768 expect (material.shape, cardTheme.shape);
6869 });
6970
70- testWidgets ('Card widget properties take priority over theme' , (WidgetTester tester) async {
71+ testWidgetsWithLeakTracking ('Card widget properties take priority over theme' , (WidgetTester tester) async {
7172 const Clip clip = Clip .hardEdge;
7273 const Color color = Colors .orange;
7374 const Color shadowColor = Colors .pink;
@@ -102,7 +103,7 @@ void main() {
102103 expect (material.shape, shape);
103104 });
104105
105- testWidgets ('CardTheme properties take priority over ThemeData properties' , (WidgetTester tester) async {
106+ testWidgetsWithLeakTracking ('CardTheme properties take priority over ThemeData properties' , (WidgetTester tester) async {
106107 final CardTheme cardTheme = _cardTheme ();
107108 final ThemeData themeData = _themeData ().copyWith (cardTheme: cardTheme);
108109
@@ -117,7 +118,7 @@ void main() {
117118 expect (material.color, cardTheme.color);
118119 });
119120
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 {
121122 final ThemeData themeData = ThemeData (useMaterial3: true );
122123
123124 await tester.pumpWidget (MaterialApp (
@@ -131,7 +132,7 @@ void main() {
131132 expect (material.color, themeData.colorScheme.surface);
132133 });
133134
134- testWidgets ('Material3 - CardTheme customizes shape' , (WidgetTester tester) async {
135+ testWidgetsWithLeakTracking ('Material3 - CardTheme customizes shape' , (WidgetTester tester) async {
135136 const CardTheme cardTheme = CardTheme (
136137 color: Colors .white,
137138 shape: BeveledRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (7 ))),
@@ -165,7 +166,7 @@ void main() {
165166 // support is deprecated and the APIs are removed, these tests
166167 // can be deleted.
167168
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 {
169170 final ThemeData themeData = ThemeData (useMaterial3: false );
170171
171172 await tester.pumpWidget (MaterialApp (
@@ -179,7 +180,7 @@ void main() {
179180 expect (material.color, themeData.cardColor);
180181 });
181182
182- testWidgets ('Material2 - Passing no CardTheme returns defaults' , (WidgetTester tester) async {
183+ testWidgetsWithLeakTracking ('Material2 - Passing no CardTheme returns defaults' , (WidgetTester tester) async {
183184 await tester.pumpWidget (MaterialApp (
184185 theme: ThemeData (useMaterial3: false ),
185186 home: const Scaffold (
@@ -201,7 +202,7 @@ void main() {
201202 ));
202203 });
203204
204- testWidgets ('Material2 - CardTheme customizes shape' , (WidgetTester tester) async {
205+ testWidgetsWithLeakTracking ('Material2 - CardTheme customizes shape' , (WidgetTester tester) async {
205206 const CardTheme cardTheme = CardTheme (
206207 color: Colors .white,
207208 shape: BeveledRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (7 ))),
0 commit comments