grid_view_test.dart 21 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
// @dart = 2.8

7 8
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart';
9
import 'package:flutter/rendering.dart';
10
import 'package:flutter/gestures.dart' show DragStartBehavior;
11

Adam Barth's avatar
Adam Barth committed
12
import '../rendering/mock_canvas.dart';
13
import '../rendering/rendering_tester.dart';
14 15 16
import 'states.dart';

void main() {
17
  testWidgets('Empty GridView', (WidgetTester tester) async {
18
    await tester.pumpWidget(
19
      Directionality(
20
        textDirection: TextDirection.ltr,
21
        child: GridView.count(
22
          dragStartBehavior: DragStartBehavior.down,
23 24 25 26 27
          crossAxisCount: 4,
          children: const <Widget>[],
        ),
      ),
    );
28 29
  });

30
  testWidgets('GridView.count control test', (WidgetTester tester) async {
31
    final List<String> log = <String>[];
32

33
    await tester.pumpWidget(
34
      Directionality(
35
        textDirection: TextDirection.ltr,
36
        child: GridView.count(
37
          dragStartBehavior: DragStartBehavior.down,
38
          crossAxisCount: 4,
39
          children: kStates.map<Widget>((String state) {
40
            return GestureDetector(
41
              dragStartBehavior: DragStartBehavior.down,
42 43 44
              onTap: () {
                log.add(state);
              },
45
              child: Container(
46
                color: const Color(0xFF0000FF),
47
                child: Text(state),
48 49 50 51 52 53
              ),
            );
          }).toList(),
        ),
      ),
    );
54 55 56 57 58 59 60 61 62 63 64 65

    expect(tester.getSize(find.text('Arkansas')), equals(const Size(200.0, 200.0)));

    for (int i = 0; i < 8; ++i) {
      await tester.tap(find.text(kStates[i]));
      expect(log, equals(<String>[kStates[i]]));
      log.clear();
    }

    expect(find.text(kStates[12]), findsNothing);
    expect(find.text('Nevada'), findsNothing);

66
    await tester.drag(find.text('Arkansas'), const Offset(0.0, -200.0));
67 68 69 70 71 72 73 74 75 76 77
    await tester.pump();

    for (int i = 0; i < 4; ++i)
      expect(find.text(kStates[i]), findsNothing);

    for (int i = 4; i < 12; ++i) {
      await tester.tap(find.text(kStates[i]));
      expect(log, equals(<String>[kStates[i]]));
      log.clear();
    }

78
    await tester.drag(find.text('Delaware'), const Offset(0.0, -4000.0));
79 80 81 82 83 84
    await tester.pump();

    expect(find.text('Alabama'), findsNothing);
    expect(find.text('Pennsylvania'), findsNothing);

    expect(tester.getCenter(find.text('Tennessee')),
85
        equals(const Offset(300.0, 100.0)));
86 87 88 89 90

    await tester.tap(find.text('Tennessee'));
    expect(log, equals(<String>['Tennessee']));
    log.clear();

91
    await tester.drag(find.text('Tennessee'), const Offset(0.0, 200.0));
92 93 94 95 96 97 98 99 100 101 102
    await tester.pump();

    await tester.tap(find.text('Tennessee'));
    expect(log, equals(<String>['Tennessee']));
    log.clear();

    await tester.tap(find.text('Pennsylvania'));
    expect(log, equals(<String>['Pennsylvania']));
    log.clear();
  });

103
  testWidgets('GridView.extent control test', (WidgetTester tester) async {
104
    final List<String> log = <String>[];
105

106
    await tester.pumpWidget(
107
      Directionality(
108
        textDirection: TextDirection.ltr,
109
        child: GridView.extent(
110
          dragStartBehavior: DragStartBehavior.down,
111
          maxCrossAxisExtent: 200.0,
112
          children: kStates.map<Widget>((String state) {
113
            return GestureDetector(
114
              dragStartBehavior: DragStartBehavior.down,
115 116 117
              onTap: () {
                log.add(state);
              },
118
              child: Container(
119
                color: const Color(0xFF0000FF),
120
                child: Text(state),
121 122 123 124 125 126
              ),
            );
          }).toList(),
        ),
      ),
    );
127 128 129 130 131 132 133 134 135 136 137

    expect(tester.getSize(find.text('Arkansas')), equals(const Size(200.0, 200.0)));

    for (int i = 0; i < 8; ++i) {
      await tester.tap(find.text(kStates[i]));
      expect(log, equals(<String>[kStates[i]]));
      log.clear();
    }

    expect(find.text('Nevada'), findsNothing);

138
    await tester.drag(find.text('Arkansas'), const Offset(0.0, -4000.0));
139 140 141 142 143
    await tester.pump();

    expect(find.text('Alabama'), findsNothing);

    expect(tester.getCenter(find.text('Tennessee')),
144
        equals(const Offset(300.0, 100.0)));
145 146 147 148 149 150

    await tester.tap(find.text('Tennessee'));
    expect(log, equals(<String>['Tennessee']));
    log.clear();
  });

151
  testWidgets('GridView large scroll jump', (WidgetTester tester) async {
152
    final List<int> log = <int>[];
153

154
    await tester.pumpWidget(
155
      Directionality(
156
        textDirection: TextDirection.ltr,
157
        child: GridView.extent(
158 159 160
          scrollDirection: Axis.horizontal,
          maxCrossAxisExtent: 200.0,
          childAspectRatio: 0.75,
161 162
          children: List<Widget>.generate(80, (int i) {
            return Builder(
163 164
              builder: (BuildContext context) {
                log.add(i);
165 166
                return Container(
                  child: Text('$i'),
167 168 169 170 171
                );
              }
            );
          }),
        ),
172
      ),
173
    );
174 175 176 177 178 179 180

    expect(tester.getSize(find.text('4')), equals(const Size(200.0 / 0.75, 200.0)));

    expect(log, equals(<int>[
      0, 1, 2, // col 0
      3, 4, 5, // col 1
      6, 7, 8, // col 2
181
      9, 10, 11, // col 3 (in cached area)
182 183 184
    ]));
    log.clear();

185 186 187 188 189 190 191
    for (int i = 0; i < 9; i++) {
      expect(find.text('$i'), findsOneWidget);
    }
    for (int i = 9; i < 80; i++) {
      expect(find.text('$i'), findsNothing);
    }

192 193
    final ScrollableState state = tester.state(find.byType(Scrollable));
    final ScrollPosition position = state.position;
194 195 196 197 198 199
    position.jumpTo(3025.0);

    expect(log, isEmpty);
    await tester.pump();

    expect(log, equals(<int>[
200
      30, 31, 32, // col 10 (in cached area)
201 202 203 204
      33, 34, 35, // col 11
      36, 37, 38, // col 12
      39, 40, 41, // col 13
      42, 43, 44, // col 14
205
      45, 46, 47, // col 15 (in cached area)
206 207 208
    ]));
    log.clear();

209 210 211 212 213 214 215 216 217 218
    for (int i = 0; i < 33; i++) {
      expect(find.text('$i'), findsNothing);
    }
    for (int i = 33; i < 45; i++) {
      expect(find.text('$i'), findsOneWidget);
    }
    for (int i = 45; i < 80; i++) {
      expect(find.text('$i'), findsNothing);
    }

219 220 221 222 223 224
    position.jumpTo(975.0);

    expect(log, isEmpty);
    await tester.pump();

    expect(log, equals(<int>[
225
      6, 7, 8, // col2 (in cached area)
226 227 228 229
      9, 10, 11, // col 3
      12, 13, 14, // col 4
      15, 16, 17, // col 5
      18, 19, 20, // col 6
230
      21, 22, 23, // col 7 (in cached area)
231 232
    ]));
    log.clear();
233 234 235 236 237 238 239 240 241 242

    for (int i = 0; i < 9; i++) {
      expect(find.text('$i'), findsNothing);
    }
    for (int i = 9; i < 21; i++) {
      expect(find.text('$i'), findsOneWidget);
    }
    for (int i = 21; i < 80; i++) {
      expect(find.text('$i'), findsNothing);
    }
243 244
  });

245
  testWidgets('GridView - change crossAxisCount', (WidgetTester tester) async {
246
    final List<int> log = <int>[];
247 248

    await tester.pumpWidget(
249
      Directionality(
250
        textDirection: TextDirection.ltr,
251
        child: GridView(
252 253 254
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 4,
          ),
255 256
          children: List<Widget>.generate(40, (int i) {
            return Builder(
257 258
              builder: (BuildContext context) {
                log.add(i);
259 260
                return Container(
                  child: Text('$i'),
261 262 263 264
                );
              }
            );
          }),
265 266 267 268 269 270 271 272 273 274
        ),
      ),
    );

    expect(tester.getSize(find.text('4')), equals(const Size(200.0, 200.0)));

    expect(log, equals(<int>[
      0, 1, 2, 3, // row 0
      4, 5, 6, 7, // row 1
      8, 9, 10, 11, // row 2
275 276
      12, 13, 14, 15, // row 3 (in cached area)
      16, 17, 18, 19, // row 4 (in cached area)
277
    ]));
278 279 280 281 282 283
    for (int i = 0; i < 12; i++) {
      expect(find.text('$i'), findsOneWidget);
    }
    for (int i = 12; i < 40; i++) {
      expect(find.text('$i'), findsNothing);
    }
284 285 286
    log.clear();

    await tester.pumpWidget(
287
      Directionality(
288
        textDirection: TextDirection.ltr,
289
        child: GridView(
290 291 292
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 2,
          ),
293 294
          children: List<Widget>.generate(40, (int i) {
            return Builder(
295 296
              builder: (BuildContext context) {
                log.add(i);
297 298
                return Container(
                  child: Text('$i'),
299 300 301 302
                );
              }
            );
          }),
303 304 305 306 307 308 309 310
        ),
      ),
    );

    expect(log, equals(<int>[
      0, 1, 2, 3, // row 0
      4, 5, 6, 7, // row 1
      8, 9, 10, 11, // row 2
311 312
      12, 13, 14, 15, // row 3 (in cached area)
      16, 17, 18, 19, // row 4 (in cached area)
313 314 315 316 317 318 319
    ]));
    log.clear();

    expect(tester.getSize(find.text('3')), equals(const Size(400.0, 400.0)));
    expect(find.text('4'), findsNothing);
  });

320
  testWidgets('GridView - change maxChildCrossAxisExtent', (WidgetTester tester) async {
321
    final List<int> log = <int>[];
322 323

    await tester.pumpWidget(
324
      Directionality(
325
        textDirection: TextDirection.ltr,
326
        child: GridView(
327 328 329
          gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
            maxCrossAxisExtent: 200.0,
          ),
330 331
          children: List<Widget>.generate(40, (int i) {
            return Builder(
332 333
              builder: (BuildContext context) {
                log.add(i);
334 335
                return Container(
                  child: Text('$i'),
336 337 338 339
                );
              }
            );
          }),
340 341 342 343 344 345 346 347 348 349
        ),
      ),
    );

    expect(tester.getSize(find.text('4')), equals(const Size(200.0, 200.0)));

    expect(log, equals(<int>[
      0, 1, 2, 3, // row 0
      4, 5, 6, 7, // row 1
      8, 9, 10, 11, // row 2
350 351
      12, 13, 14, 15, // row 3 (in cached area)
      16, 17, 18, 19, // row 4 (in cached area)
352
    ]));
353 354 355 356 357 358
    for (int i = 0; i < 12; i++) {
      expect(find.text('$i'), findsOneWidget);
    }
    for (int i = 12; i < 40; i++) {
      expect(find.text('$i'), findsNothing);
    }
359 360 361
    log.clear();

    await tester.pumpWidget(
362
      Directionality(
363
        textDirection: TextDirection.ltr,
364
        child: GridView(
365 366 367
          gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
            maxCrossAxisExtent: 400.0,
          ),
368 369
          children: List<Widget>.generate(40, (int i) {
            return Builder(
370 371
              builder: (BuildContext context) {
                log.add(i);
372 373
                return Container(
                  child: Text('$i'),
374 375 376 377
                );
              }
            );
          }),
378 379 380 381 382 383 384 385
        ),
      ),
    );

    expect(log, equals(<int>[
      0, 1, 2, 3, // row 0
      4, 5, 6, 7, // row 1
      8, 9, 10, 11, // row 2
386 387
      12, 13, 14, 15, // row 3 (in cached area)
      16, 17, 18, 19, // row 4 (in cached area)
388 389 390 391 392 393
    ]));
    log.clear();

    expect(tester.getSize(find.text('3')), equals(const Size(400.0, 400.0)));
    expect(find.text('4'), findsNothing);
  });
394

Adam Barth's avatar
Adam Barth committed
395
  testWidgets('One-line GridView paints', (WidgetTester tester) async {
396
    const Color green = Color(0xFF00FF00);
Adam Barth's avatar
Adam Barth committed
397

398
    final Container container = Container(
Adam Barth's avatar
Adam Barth committed
399
      decoration: const BoxDecoration(
400
        color: green,
Adam Barth's avatar
Adam Barth committed
401 402 403
      ),
    );

404
    await tester.pumpWidget(
405
      Directionality(
406
        textDirection: TextDirection.ltr,
407 408
        child: Center(
          child: SizedBox(
409
            height: 200.0,
410
            child: GridView.count(
411
              cacheExtent: 0.0,
412 413 414 415
              crossAxisCount: 2,
              children: <Widget>[ container, container, container, container ],
            ),
          ),
Adam Barth's avatar
Adam Barth committed
416 417
        ),
      ),
418
    );
Adam Barth's avatar
Adam Barth committed
419 420 421 422 423

    expect(find.byType(GridView), paints..rect(color: green)..rect(color: green));
    expect(find.byType(GridView), isNot(paints..rect(color: green)..rect(color: green)..rect(color: green)));
  });

424 425
  testWidgets('GridView in zero context', (WidgetTester tester) async {
    await tester.pumpWidget(
426
      Directionality(
427
        textDirection: TextDirection.ltr,
428 429
        child: Center(
          child: SizedBox(
430 431
            width: 0.0,
            height: 0.0,
432
            child: GridView.count(
433
              crossAxisCount: 4,
434 435 436
              children: List<Widget>.generate(20, (int i) {
                return Container(
                  child: Text('$i'),
437 438 439 440 441 442 443 444
                );
              }),
            ),
          ),
        ),
      ),
    );

445
    expect(find.text('0'), findsNothing);
446 447 448 449 450
    expect(find.text('1'), findsNothing);
  });

  testWidgets('GridView in unbounded context', (WidgetTester tester) async {
    await tester.pumpWidget(
451
      Directionality(
452
        textDirection: TextDirection.ltr,
453 454
        child: SingleChildScrollView(
          child: GridView.count(
455
            crossAxisCount: 4,
456
            shrinkWrap: true,
457 458 459
            children: List<Widget>.generate(20, (int i) {
              return Container(
                child: Text('$i'),
460 461 462 463 464 465 466 467
              );
            }),
          ),
        ),
      ),
    );

    expect(find.text('0'), findsOneWidget);
468
    expect(find.text('19'), findsOneWidget);
469 470
  });

471
  testWidgets('GridView.builder control test', (WidgetTester tester) async {
472
    await tester.pumpWidget(
473
      Directionality(
474
        textDirection: TextDirection.ltr,
475
        child: GridView.builder(
476 477 478
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 4,
          ),
479
          shrinkWrap: true,
480 481
          itemCount: 20,
          itemBuilder: (BuildContext context, int index) {
482 483
            return Container(
              child: Text('$index'),
484
            );
485
          },
486 487 488
        ),
      ),
    );
489 490 491 492 493
    expect(find.text('0'), findsOneWidget);
    expect(find.text('11'), findsOneWidget);
    expect(find.text('12'), findsNothing);
  });

494 495
  testWidgets('GridView.builder with undefined itemCount', (WidgetTester tester) async {
    await tester.pumpWidget(
496
      Directionality(
497
        textDirection: TextDirection.ltr,
498
        child: GridView.builder(
499 500 501 502 503
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 4,
          ),
          shrinkWrap: true,
          itemBuilder: (BuildContext context, int index) {
504 505
            return Container(
              child: Text('$index'),
506 507 508 509 510 511 512 513 514 515 516 517
            );
          },
        ),
      ),
    );
    expect(find.text('0'), findsOneWidget);
    expect(find.text('11'), findsOneWidget);
    await tester.drag(find.byType(GridView), const Offset(0.0, -300.0));
    await tester.pump(const Duration(milliseconds: 200));
    expect(find.text('13'), findsOneWidget);
  });

518
  testWidgets('GridView cross axis layout', (WidgetTester tester) async {
519
    final Key target = UniqueKey();
520 521

    Widget build(TextDirection textDirection) {
522
      return Directionality(
523
        textDirection: textDirection,
524
        child: GridView.count(
525 526
          crossAxisCount: 4,
          children: <Widget>[
527
            Container(key: target),
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542
          ],
        ),
      );
    }

    await tester.pumpWidget(build(TextDirection.ltr));

    expect(tester.getTopLeft(find.byKey(target)), Offset.zero);
    expect(tester.getBottomRight(find.byKey(target)), const Offset(200.0, 200.0));

    await tester.pumpWidget(build(TextDirection.rtl));

    expect(tester.getTopLeft(find.byKey(target)), const Offset(600.0, 0.0));
    expect(tester.getBottomRight(find.byKey(target)), const Offset(800.0, 200.0));
  });
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570

  testWidgets('GridView crossAxisSpacing', (WidgetTester tester) async {
    // Regression test for https://github.com/flutter/flutter/issues/27151.
    final Key target = UniqueKey();

    Widget build(TextDirection textDirection) {
      return Directionality(
        textDirection: textDirection,
        child: GridView.count(
          crossAxisCount: 4,
          crossAxisSpacing: 8.0,
          children: <Widget>[
            Container(key: target),
          ],
        ),
      );
    }

    await tester.pumpWidget(build(TextDirection.ltr));

    expect(tester.getTopLeft(find.byKey(target)), Offset.zero);
    expect(tester.getBottomRight(find.byKey(target)), const Offset(194.0, 194.0));

    await tester.pumpWidget(build(TextDirection.rtl));

    expect(tester.getTopLeft(find.byKey(target)), const Offset(606.0, 0.0));
    expect(tester.getBottomRight(find.byKey(target)), const Offset(800.0, 194.0));
  });
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606

  testWidgets('GridView does not cache itemBuilder calls', (WidgetTester tester) async {
    final Map<int, int> counters = <int, int>{};

    await tester.pumpWidget(Directionality(
      textDirection: TextDirection.ltr,
      child: GridView.builder(
        itemCount: 1000,
        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
        itemBuilder: (BuildContext context, int index) {
          counters[index] ??= 0;
          counters[index] += 1;
          return SizedBox(
            key: ValueKey<int>(index),
            width: 200,
            height: 200,
          );
        },
      ),
    ));

    expect(find.byKey(const ValueKey<int>(4)), findsOneWidget);
    expect(counters[4], 1);

    await tester.fling(find.byType(GridView), const Offset(0, -300), 5000);
    await tester.pumpAndSettle();

    expect(find.byKey(const ValueKey<int>(4)), findsNothing);
    expect(counters[4], 1);

    await tester.fling(find.byType(GridView), const Offset(0, 300), 5000);
    await tester.pumpAndSettle();

    expect(find.byKey(const ValueKey<int>(4)), findsOneWidget);
    expect(counters[4], 2);
  });
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708

  testWidgets('GridView respects clipBehavior', (WidgetTester tester) async {
    await tester.pumpWidget(
      Directionality(
        textDirection: TextDirection.ltr,
        child: GridView(
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
          children: <Widget>[Container(height: 2000.0)],
        ),
      ),
    );

    // 1st, check that the render object has received the default clip behavior.
    final RenderViewport renderObject = tester.allRenderObjects.whereType<RenderViewport>().first;
    expect(renderObject.clipBehavior, equals(Clip.hardEdge));

    // 2nd, check that the painting context has received the default clip behavior.
    final TestClipPaintingContext context = TestClipPaintingContext();
    renderObject.paint(context, Offset.zero);
    expect(context.clipBehavior, equals(Clip.hardEdge));

    // 3rd, pump a new widget to check that the render object can update its clip behavior.
    await tester.pumpWidget(
      Directionality(
        textDirection: TextDirection.ltr,
        child: GridView(
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
          children: <Widget>[Container(height: 2000.0)],
          clipBehavior: Clip.antiAlias,
        ),
      ),
    );
    expect(renderObject.clipBehavior, equals(Clip.antiAlias));

    // 4th, check that a non-default clip behavior can be sent to the painting context.
    renderObject.paint(context, Offset.zero);
    expect(context.clipBehavior, equals(Clip.antiAlias));
  });

  testWidgets('GridView.builder respects clipBehavior', (WidgetTester tester) async {
    await tester.pumpWidget(
      Directionality(
        textDirection: TextDirection.ltr,
        child: GridView.builder(
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
          itemCount: 10,
          itemBuilder: (BuildContext _, int __) => Container(height: 2000.0),
          clipBehavior: Clip.antiAlias,
        ),
      ),
    );
    final RenderViewport renderObject = tester.allRenderObjects.whereType<RenderViewport>().first;
    expect(renderObject.clipBehavior, equals(Clip.antiAlias));
  });

  testWidgets('GridView.custom respects clipBehavior', (WidgetTester tester) async {
    await tester.pumpWidget(
      Directionality(
        textDirection: TextDirection.ltr,
        child: GridView.custom(
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
          childrenDelegate: SliverChildBuilderDelegate(
                (BuildContext context, int index) => Container(height: 2000.0),
            childCount: 1,
          ),
          clipBehavior: Clip.antiAlias,
        ),
      ),
    );
    final RenderViewport renderObject = tester.allRenderObjects.whereType<RenderViewport>().first;
    expect(renderObject.clipBehavior, equals(Clip.antiAlias));
  });

  testWidgets('GridView.count respects clipBehavior', (WidgetTester tester) async {
    await tester.pumpWidget(
      Directionality(
        textDirection: TextDirection.ltr,
        child: GridView.count(
          crossAxisCount: 3,
          children: <Widget>[Container(height: 2000.0)],
          clipBehavior: Clip.antiAlias,
        ),
      ),
    );
    final RenderViewport renderObject = tester.allRenderObjects.whereType<RenderViewport>().first;
    expect(renderObject.clipBehavior, equals(Clip.antiAlias));
  });

  testWidgets('GridView.extent respects clipBehavior', (WidgetTester tester) async {
    await tester.pumpWidget(
      Directionality(
        textDirection: TextDirection.ltr,
        child: GridView.extent(
          maxCrossAxisExtent: 1000,
          children: <Widget>[Container(height: 2000.0)],
          clipBehavior: Clip.antiAlias,
        ),
      ),
    );
    final RenderViewport renderObject = tester.allRenderObjects.whereType<RenderViewport>().first;
    expect(renderObject.clipBehavior, equals(Clip.antiAlias));
  });
709
}