11import  'package:flutter/material.dart' ;
2+ import  'package:flutter/rendering.dart' ;
23import  'package:flutter/services.dart' ;
34import  'package:flutter_test/flutter_test.dart' ;
45import  'package:sentry_flutter/sentry_flutter.dart' ;
@@ -12,7 +13,6 @@ import 'test_widget.dart';
1213// We'll keep these tests although they're not unit-tests anymore. 
1314void  main () async  {
1415  TestWidgetsFlutterBinding .ensureInitialized ();
15-   const  defaultBounds =  Rect .fromLTRB (0 , 0 , 1000 , 1000 );
1616  final  rootBundle =  TestAssetBundle ();
1717  final  otherBundle =  TestAssetBundle ();
1818  final  logger =  MockLogger ();
@@ -43,8 +43,7 @@ void main() async {
4343      final  element =  await  pumpTestElement (tester);
4444      sut.obscure (
4545          context:  element,
46-           pixelRatio:  1.0 ,
47-           bounds:  defaultBounds,
46+           root:  element.renderObject as  RenderRepaintBoundary ,
4847          colorScheme:  colorScheme);
4948      expect (sut.items.length, 6 );
5049    });
@@ -54,8 +53,7 @@ void main() async {
5453      final  element =  await  pumpTestElement (tester);
5554      sut.obscure (
5655          context:  element,
57-           pixelRatio:  1.0 ,
58-           bounds:  defaultBounds,
56+           root:  element.renderObject as  RenderRepaintBoundary ,
5957          colorScheme:  colorScheme);
6058      expect (sut.items.length, 0 );
6159    });
@@ -66,7 +64,7 @@ void main() async {
6664      final  element =  await  pumpTestElement (tester);
6765      sut.obscure (
6866          context:  element,
69-           pixelRatio :   1.0 ,
67+           root :  element.renderObject  as   RenderRepaintBoundary ,
7068          bounds:  Rect .fromLTRB (0 , 0 , 100 , 100 ),
7169          colorScheme:  colorScheme);
7270      expect (sut.items.length, 1 );
@@ -77,8 +75,7 @@ void main() async {
7775      final  element =  await  pumpTestElement (tester);
7876      sut.obscure (
7977          context:  element,
80-           pixelRatio:  1.0 ,
81-           bounds:  defaultBounds,
78+           root:  element.renderObject as  RenderRepaintBoundary ,
8279          colorScheme:  colorScheme);
8380      expect (sut.items.length, 6 );
8481      expect (
@@ -100,8 +97,7 @@ void main() async {
10097      final  element =  await  pumpTestElement (tester);
10198      sut.obscure (
10299          context:  element,
103-           pixelRatio:  1.0 ,
104-           bounds:  defaultBounds,
100+           root:  element.renderObject as  RenderRepaintBoundary ,
105101          colorScheme:  colorScheme);
106102      expect (sut.items.length, 3 );
107103    });
@@ -144,8 +140,7 @@ void main() async {
144140      final  element =  await  pumpTestElement (tester);
145141      sut.obscure (
146142          context:  element,
147-           pixelRatio:  1.0 ,
148-           bounds:  defaultBounds,
143+           root:  element.renderObject as  RenderRepaintBoundary ,
149144          colorScheme:  colorScheme);
150145      expect (sut.items.length, 0 );
151146    });
@@ -156,7 +151,7 @@ void main() async {
156151      final  element =  await  pumpTestElement (tester);
157152      sut.obscure (
158153          context:  element,
159-           pixelRatio :   1.0 ,
154+           root :  element.renderObject  as   RenderRepaintBoundary ,
160155          bounds:  Rect .fromLTRB (0 , 0 , 500 , 100 ),
161156          colorScheme:  colorScheme);
162157      expect (sut.items.length, 1 );
@@ -167,8 +162,7 @@ void main() async {
167162      final  element =  await  pumpTestElement (tester);
168163      sut.obscure (
169164          context:  element,
170-           pixelRatio:  1.0 ,
171-           bounds:  defaultBounds,
165+           root:  element.renderObject as  RenderRepaintBoundary ,
172166          colorScheme:  colorScheme);
173167      expect (sut.items.length, 3 );
174168      expect (boundsRect (sut.items[0 ]), '1x1' );
@@ -184,8 +178,7 @@ void main() async {
184178    ]);
185179    sut.obscure (
186180        context:  element,
187-         pixelRatio:  1.0 ,
188-         bounds:  defaultBounds,
181+         root:  element.renderObject as  RenderRepaintBoundary ,
189182        colorScheme:  colorScheme);
190183    expect (sut.items.length, 1 );
191184    expect (boundsRect (sut.items[0 ]), '344x248' );
@@ -200,8 +193,7 @@ void main() async {
200193    ]);
201194    sut.obscure (
202195        context:  element,
203-         pixelRatio:  1.0 ,
204-         bounds:  defaultBounds,
196+         root:  element.renderObject as  RenderRepaintBoundary ,
205197        colorScheme:  colorScheme);
206198    expect (sut.items, isEmpty);
207199  });
@@ -213,16 +205,14 @@ void main() async {
213205    ]);
214206    sut.obscure (
215207        context:  element,
216-         pixelRatio:  1.0 ,
217-         bounds:  defaultBounds,
208+         root:  element.renderObject as  RenderRepaintBoundary ,
218209        colorScheme:  colorScheme);
219210    expect (sut.items.length, 1 );
220211    expect (boundsRect (sut.items[0 ]), '144x48' );
221212    sut.throwInObscure =  true ;
222213    sut.obscure (
223214        context:  element,
224-         pixelRatio:  1.0 ,
225-         bounds:  defaultBounds,
215+         root:  element.renderObject as  RenderRepaintBoundary ,
226216        colorScheme:  colorScheme);
227217    expect (sut.items.length, 1 );
228218    expect (boundsRect (sut.items[0 ]), '344x248' );
@@ -239,8 +229,7 @@ void main() async {
239229            await  pumpTestElement (tester, children:  [CustomPasswordWidget ()]);
240230        sut.obscure (
241231            context:  element,
242-             pixelRatio:  1.0 ,
243-             bounds:  defaultBounds,
232+             root:  element.renderObject as  RenderRepaintBoundary ,
244233            colorScheme:  colorScheme);
245234        final  logMessages =  logger.items
246235            .where ((item) =>  item.level ==  SentryLevel .warning)
0 commit comments