@@ -11,13 +11,9 @@ void main() {
11
11
testWidgets (
12
12
'DynamicGridView works when using DynamicSliverGridDelegateWithFixedCrossAxisCount' ,
13
13
(WidgetTester tester) async {
14
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
15
- // ignore: deprecated_member_use
16
- tester.binding.window.physicalSizeTestValue = const Size (400 , 100 );
17
-
18
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
19
- // ignore: deprecated_member_use
20
- tester.binding.window.devicePixelRatioTestValue = 1.0 ;
14
+ tester.view.physicalSize = const Size (400 , 100 );
15
+ tester.view.devicePixelRatio = 1.0 ;
16
+ addTearDown (tester.view.reset);
21
17
22
18
await tester.pumpWidget (
23
19
MaterialApp (
@@ -59,13 +55,9 @@ void main() {
59
55
testWidgets (
60
56
'DynamicGridView works when using DynamicSliverGridDelegateWithMaxCrossAxisExtent' ,
61
57
(WidgetTester tester) async {
62
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
63
- // ignore: deprecated_member_use
64
- tester.binding.window.physicalSizeTestValue = const Size (440 , 100 );
65
-
66
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
67
- // ignore: deprecated_member_use
68
- tester.binding.window.devicePixelRatioTestValue = 1.0 ;
58
+ tester.view.physicalSize = const Size (440 , 100 );
59
+ tester.view.devicePixelRatio = 1.0 ;
60
+ addTearDown (tester.view.reset);
69
61
70
62
await tester.pumpWidget (
71
63
MaterialApp (
@@ -106,13 +98,9 @@ void main() {
106
98
group ('DynamicGridView.staggered' , () {
107
99
testWidgets ('DynamicGridView.staggered works with simple layout' ,
108
100
(WidgetTester tester) async {
109
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
110
- // ignore: deprecated_member_use
111
- tester.binding.window.physicalSizeTestValue = const Size (400 , 100 );
112
-
113
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
114
- // ignore: deprecated_member_use
115
- tester.binding.window.devicePixelRatioTestValue = 1.0 ;
101
+ tester.view.physicalSize = const Size (400 , 100 );
102
+ tester.view.devicePixelRatio = 1.0 ;
103
+ addTearDown (tester.view.reset);
116
104
117
105
await tester.pumpWidget (
118
106
MaterialApp (
@@ -158,13 +146,9 @@ void main() {
158
146
});
159
147
testWidgets ('DynamicGridView.staggered works with a horizontal grid' ,
160
148
(WidgetTester tester) async {
161
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
162
- // ignore: deprecated_member_use
163
- tester.binding.window.physicalSizeTestValue = const Size (100 , 500 );
164
-
165
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
166
- // ignore: deprecated_member_use
167
- tester.binding.window.devicePixelRatioTestValue = 1.0 ;
149
+ tester.view.physicalSize = const Size (100 , 500 );
150
+ tester.view.devicePixelRatio = 1.0 ;
151
+ addTearDown (tester.view.reset);
168
152
169
153
await tester.pumpWidget (
170
154
MaterialApp (
@@ -216,13 +200,9 @@ void main() {
216
200
});
217
201
testWidgets ('DynamicGridView.staggered works with a reversed grid' ,
218
202
(WidgetTester tester) async {
219
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
220
- // ignore: deprecated_member_use
221
- tester.binding.window.physicalSizeTestValue = const Size (600 , 200 );
222
-
223
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
224
- // ignore: deprecated_member_use
225
- tester.binding.window.devicePixelRatioTestValue = 1.0 ;
203
+ tester.view.physicalSize = const Size (600 , 200 );
204
+ tester.view.devicePixelRatio = 1.0 ;
205
+ addTearDown (tester.view.reset);
226
206
227
207
await tester.pumpWidget (
228
208
MaterialApp (
@@ -290,13 +270,10 @@ void main() {
290
270
291
271
testWidgets ('DynamicGridView.staggered deletes children appropriately' ,
292
272
(WidgetTester tester) async {
293
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
294
- // ignore: deprecated_member_use
295
- tester.binding.window.physicalSizeTestValue = const Size ( 600 , 1000 );
273
+ tester.view.physicalSize = const Size ( 600 , 1000 );
274
+ tester.view.devicePixelRatio = 1.0 ;
275
+ addTearDown ( tester.view.reset );
296
276
297
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
298
- // ignore: deprecated_member_use
299
- tester.binding.window.devicePixelRatioTestValue = 1.0 ;
300
277
final List <Widget > children = List <Widget >.generate (
301
278
50 ,
302
279
(int index) => SizedBox (
@@ -375,13 +352,9 @@ void main() {
375
352
group ('DynamicGridView.builder' , () {
376
353
testWidgets ('DynamicGridView.builder works with a staggered layout' ,
377
354
(WidgetTester tester) async {
378
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
379
- // ignore: deprecated_member_use
380
- tester.binding.window.physicalSizeTestValue = const Size (400 , 100 );
381
-
382
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
383
- // ignore: deprecated_member_use
384
- tester.binding.window.devicePixelRatioTestValue = 1.0 ;
355
+ tester.view.physicalSize = const Size (400 , 100 );
356
+ tester.view.devicePixelRatio = 1.0 ;
357
+ addTearDown (tester.view.reset);
385
358
386
359
await tester.pumpWidget (
387
360
MaterialApp (
@@ -430,13 +403,9 @@ void main() {
430
403
testWidgets (
431
404
'DynamicGridView.builder works with an infinite grid using a staggered layout' ,
432
405
(WidgetTester tester) async {
433
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
434
- // ignore: deprecated_member_use
435
- tester.binding.window.physicalSizeTestValue = const Size (400 , 100 );
436
-
437
- // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
438
- // ignore: deprecated_member_use
439
- tester.binding.window.devicePixelRatioTestValue = 1.0 ;
406
+ tester.view.physicalSize = const Size (400 , 100 );
407
+ tester.view.devicePixelRatio = 1.0 ;
408
+ addTearDown (tester.view.reset);
440
409
441
410
await tester.pumpWidget (
442
411
MaterialApp (
0 commit comments