@@ -37,14 +37,14 @@ class BenchTextOutOfPictureBounds extends SceneBuilderRecorder {
3737 paragraphCount: 500 ,
3838 minWordCountPerParagraph: 2 ,
3939 maxWordCountPerParagraph: 4 ,
40- widthConstraint: window .physicalSize.width / 2 ,
40+ widthConstraint: view .physicalSize.width / 2 ,
4141 color: red,
4242 );
4343 multiLineParagraphs = generateLaidOutParagraphs (
4444 paragraphCount: 50 ,
4545 minWordCountPerParagraph: 30 ,
4646 maxWordCountPerParagraph: 49 ,
47- widthConstraint: window .physicalSize.width / 2 ,
47+ widthConstraint: view .physicalSize.width / 2 ,
4848 color: green,
4949 );
5050 }
@@ -61,19 +61,19 @@ class BenchTextOutOfPictureBounds extends SceneBuilderRecorder {
6161 void onDrawFrame (SceneBuilder sceneBuilder) {
6262 final PictureRecorder pictureRecorder = PictureRecorder ();
6363 final Canvas canvas = Canvas (pictureRecorder);
64- final Size screenSize = window .physicalSize;
64+ final Size viewSize = view .physicalSize;
6565 const double padding = 10.0 ;
6666
6767 // Fills a single cell with random text.
6868 void fillCellWithText (List <Paragraph > textSource) {
6969 canvas.save ();
7070 double topOffset = 0 ;
71- while (topOffset < screenSize .height) {
71+ while (topOffset < viewSize .height) {
7272 final Paragraph paragraph =
7373 textSource[_random.nextInt (textSource.length)];
7474
7575 // Give it enough space to make sure it ends up being a single-line paragraph.
76- paragraph.layout (ParagraphConstraints (width: screenSize .width / 2 ));
76+ paragraph.layout (ParagraphConstraints (width: viewSize .width / 2 ));
7777
7878 canvas.drawParagraph (paragraph, Offset .zero);
7979 canvas.translate (0 , paragraph.height + padding);
@@ -83,12 +83,12 @@ class BenchTextOutOfPictureBounds extends SceneBuilderRecorder {
8383 }
8484
8585 // Starting with the top-left cell, fill every cell with text.
86- canvas.translate (- screenSize .width, - screenSize .height);
86+ canvas.translate (- viewSize .width, - viewSize .height);
8787 for (int row = 0 ; row < 3 ; row++ ) {
8888 canvas.save ();
8989 for (int col = 0 ; col < 3 ; col++ ) {
9090 canvas.drawRect (
91- Offset .zero & screenSize ,
91+ Offset .zero & viewSize ,
9292 Paint ()
9393 ..style = PaintingStyle .stroke
9494 ..strokeWidth = 2.0 ,
@@ -98,19 +98,19 @@ class BenchTextOutOfPictureBounds extends SceneBuilderRecorder {
9898
9999 // Fill multi-line text.
100100 canvas.save ();
101- canvas.translate (screenSize .width / 2 , 0 );
101+ canvas.translate (viewSize .width / 2 , 0 );
102102 fillCellWithText (multiLineParagraphs);
103103 canvas.restore ();
104104
105105 // Shift to next column.
106- canvas.translate (screenSize .width, 0 );
106+ canvas.translate (viewSize .width, 0 );
107107 }
108108
109109 // Undo horizontal shift.
110110 canvas.restore ();
111111
112112 // Shift to next row.
113- canvas.translate (0 , screenSize .height);
113+ canvas.translate (0 , viewSize .height);
114114 }
115115
116116 final Picture picture = pictureRecorder.endRecording ();
0 commit comments