row_test.dart 42.4 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
import 'package:flutter/foundation.dart';
8 9
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
import 'package:flutter_test/flutter_test.dart';

class OrderPainter extends CustomPainter {
  const OrderPainter(this.index);

  final int index;

  static List<int> log = <int>[];

  @override
  void paint(Canvas canvas, Size size) {
    log.add(index);
  }

  @override
  bool shouldRepaint(OrderPainter old) => false;
}

28
Widget log(int index) => CustomPaint(painter: OrderPainter(index));
29 30

void main() {
31 32 33 34
  // NO DIRECTION

  testWidgets('Row with one Flexible child - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
35 36 37 38
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
39 40 41 42 43 44 45 46

    final FlutterExceptionHandler oldHandler = FlutterError.onError;
    dynamic exception;
    FlutterError.onError = (FlutterErrorDetails details) {
      exception ??= details.exception;
    };

    // Default is MainAxisAlignment.start so this should fail, asking for a direction.
47 48
    await tester.pumpWidget(Center(
      child: Row(
49 50
        key: rowKey,
        children: <Widget>[
51 52 53
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Expanded(child: Container(key: child1Key, width: 100.0, height: 100.0, child: log(2))),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
54 55 56 57 58 59 60 61 62 63 64 65
        ],
      ),
    ));

    FlutterError.onError = oldHandler;
    expect(exception, isAssertionError);
    expect(exception.toString(), contains('textDirection'));
    expect(OrderPainter.log, <int>[]);
  });

  testWidgets('Row with default main axis parameters - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
66 67 68 69
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
70 71 72 73 74 75 76 77

    final FlutterExceptionHandler oldHandler = FlutterError.onError;
    dynamic exception;
    FlutterError.onError = (FlutterErrorDetails details) {
      exception ??= details.exception;
    };

    // Default is MainAxisAlignment.start so this should fail too.
78 79
    await tester.pumpWidget(Center(
      child: Row(
80 81
        key: rowKey,
        children: <Widget>[
82 83 84
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
85 86 87 88 89 90 91 92 93 94 95 96
        ],
      ),
    ));

    FlutterError.onError = oldHandler;
    expect(exception, isAssertionError);
    expect(exception.toString(), contains('textDirection'));
    expect(OrderPainter.log, <int>[]);
  });

  testWidgets('Row with MainAxisAlignment.center - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
97 98 99
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
100 101 102 103 104 105 106 107

    final FlutterExceptionHandler oldHandler = FlutterError.onError;
    dynamic exception;
    FlutterError.onError = (FlutterErrorDetails details) {
      exception ??= details.exception;
    };

    // More than one child, so it's not clear what direction to lay out in: should fail.
108 109
    await tester.pumpWidget(Center(
      child: Row(
110 111 112
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
113 114
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
115 116 117 118 119 120 121 122 123 124 125 126
        ],
      ),
    ));

    FlutterError.onError = oldHandler;
    expect(exception, isAssertionError);
    expect(exception.toString(), contains('textDirection'));
    expect(OrderPainter.log, <int>[]);
  });

  testWidgets('Row with MainAxisAlignment.end - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
127 128 129 130
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
131 132 133 134 135 136 137 138

    final FlutterExceptionHandler oldHandler = FlutterError.onError;
    dynamic exception;
    FlutterError.onError = (FlutterErrorDetails details) {
      exception ??= details.exception;
    };

    // No direction so this should fail, asking for a direction.
139 140
    await tester.pumpWidget(Center(
      child: Row(
141 142 143
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.end,
        children: <Widget>[
144 145 146
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
147 148 149 150 151 152 153 154 155 156 157 158
        ],
      ),
    ));

    FlutterError.onError = oldHandler;
    expect(exception, isAssertionError);
    expect(exception.toString(), contains('textDirection'));
    expect(OrderPainter.log, <int>[]);
  });

  testWidgets('Row with MainAxisAlignment.spaceBetween - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
159 160 161 162
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
163 164 165 166 167 168 169 170

    final FlutterExceptionHandler oldHandler = FlutterError.onError;
    dynamic exception;
    FlutterError.onError = (FlutterErrorDetails details) {
      exception ??= details.exception;
    };

    // More than one child, so it's not clear what direction to lay out in: should fail.
171 172
    await tester.pumpWidget(Center(
      child: Row(
173 174 175
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
176 177 178
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
179 180 181 182 183 184 185 186 187 188 189 190
        ],
      ),
    ));

    FlutterError.onError = oldHandler;
    expect(exception, isAssertionError);
    expect(exception.toString(), contains('textDirection'));
    expect(OrderPainter.log, <int>[]);
  });

  testWidgets('Row with MainAxisAlignment.spaceAround - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
191 192 193 194 195
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
    const Key child3Key = Key('child3');
196 197 198 199 200 201 202 203

    final FlutterExceptionHandler oldHandler = FlutterError.onError;
    dynamic exception;
    FlutterError.onError = (FlutterErrorDetails details) {
      exception ??= details.exception;
    };

    // More than one child, so it's not clear what direction to lay out in: should fail.
204 205
    await tester.pumpWidget(Center(
      child: Row(
206 207 208
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: <Widget>[
209 210 211 212
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
          Container(key: child3Key, width: 100.0, height: 100.0, child: log(4)),
213 214 215 216 217 218 219 220 221 222 223 224
        ],
      ),
    ));

    FlutterError.onError = oldHandler;
    expect(exception, isAssertionError);
    expect(exception.toString(), contains('textDirection'));
    expect(OrderPainter.log, <int>[]);
  });

  testWidgets('Row with MainAxisAlignment.spaceEvenly - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
225 226 227 228
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
229 230 231 232 233 234 235 236

    final FlutterExceptionHandler oldHandler = FlutterError.onError;
    dynamic exception;
    FlutterError.onError = (FlutterErrorDetails details) {
      exception ??= details.exception;
    };

    // More than one child, so it's not clear what direction to lay out in: should fail.
237 238
    await tester.pumpWidget(Center(
      child: Row(
239 240 241
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: <Widget>[
242 243 244
          Container(key: child0Key, width: 200.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 200.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 200.0, height: 100.0, child: log(3)),
245 246 247 248 249 250 251 252 253 254 255 256
        ],
      ),
    ));

    FlutterError.onError = oldHandler;
    expect(exception, isAssertionError);
    expect(exception.toString(), contains('textDirection'));
    expect(OrderPainter.log, <int>[]);
  });

  testWidgets('Row and MainAxisSize.min - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
257 258 259
    const Key rowKey = Key('rowKey');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
260 261 262 263 264 265 266 267

    final FlutterExceptionHandler oldHandler = FlutterError.onError;
    dynamic exception;
    FlutterError.onError = (FlutterErrorDetails details) {
      exception ??= details.exception;
    };

    // Default is MainAxisAlignment.start so this should fail, asking for a direction.
268 269
    await tester.pumpWidget(Center(
      child: Row(
270 271 272
        key: rowKey,
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
273 274
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 150.0, height: 100.0, child: log(2)),
275 276 277 278 279 280 281 282 283 284 285 286
        ],
      ),
    ));

    FlutterError.onError = oldHandler;
    expect(exception, isAssertionError);
    expect(exception.toString(), contains('textDirection'));
    expect(OrderPainter.log, <int>[]);
  });

  testWidgets('Row MainAxisSize.min layout at zero size - no textDirection', (WidgetTester tester) async {
    OrderPainter.log.clear();
287
    const Key childKey = Key('childKey');
288

289 290
    await tester.pumpWidget(Center(
      child: Container(
291 292
        width: 0.0,
        height: 0.0,
293
        child: Row(
294 295 296
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
297
            Container(
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
              key: childKey,
              width: 100.0,
              height: 100.0,
            ),
          ],
        ),
      ),
    ));

    final RenderBox renderBox = tester.renderObject(find.byKey(childKey));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(0.0));
  });


  // LTR

  testWidgets('Row with one Flexible child - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
317 318 319 320
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
321 322 323 324

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // Default is MainAxisAlignment.start so children so the children's
    // left edges should be at 0, 100, 700, child2's width should be 600
325 326
    await tester.pumpWidget(Center(
      child: Row(
327
        key: rowKey,
328
        textDirection: TextDirection.ltr,
329
        children: <Widget>[
330 331 332
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Expanded(child: Container(key: child1Key, width: 100.0, height: 100.0, child: log(2))),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
333 334
        ],
      ),
335 336 337 338 339 340 341 342 343 344 345 346
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
347
    boxParentData = renderBox.parentData as BoxParentData;
348 349 350 351 352
    expect(boxParentData.offset.dx, equals(0.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(600.0));
    expect(renderBox.size.height, equals(100.0));
353
    boxParentData = renderBox.parentData as BoxParentData;
354 355 356 357 358
    expect(boxParentData.offset.dx, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
359
    boxParentData = renderBox.parentData as BoxParentData;
360
    expect(boxParentData.offset.dx, equals(700.0));
361 362

    expect(OrderPainter.log, <int>[1, 2, 3]);
363 364
  });

365 366
  testWidgets('Row with default main axis parameters - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
367 368 369 370
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
371 372 373 374

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // Default is MainAxisAlignment.start so children so the children's
    // left edges should be at 0, 100, 200
375 376
    await tester.pumpWidget(Center(
      child: Row(
377
        key: rowKey,
378
        textDirection: TextDirection.ltr,
379
        children: <Widget>[
380 381 382
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
383 384
        ],
      ),
385 386 387 388 389 390 391 392 393 394 395 396
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
397
    boxParentData = renderBox.parentData as BoxParentData;
398 399 400 401 402
    expect(boxParentData.offset.dx, equals(0.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
403
    boxParentData = renderBox.parentData as BoxParentData;
404 405 406 407 408
    expect(boxParentData.offset.dx, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
409
    boxParentData = renderBox.parentData as BoxParentData;
410
    expect(boxParentData.offset.dx, equals(200.0));
411 412

    expect(OrderPainter.log, <int>[1, 2, 3]);
413 414
  });

415 416
  testWidgets('Row with MainAxisAlignment.center - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
417 418 419
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
420 421 422

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 100x100 children's left edges should be at 300, 400
423 424
    await tester.pumpWidget(Center(
      child: Row(
425 426
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.center,
427
        textDirection: TextDirection.ltr,
428
        children: <Widget>[
429 430
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
431 432
        ],
      ),
433 434 435 436 437 438 439 440 441 442 443 444
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
445
    boxParentData = renderBox.parentData as BoxParentData;
446 447 448 449 450
    expect(boxParentData.offset.dx, equals(300.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
451
    boxParentData = renderBox.parentData as BoxParentData;
452
    expect(boxParentData.offset.dx, equals(400.0));
453 454

    expect(OrderPainter.log, <int>[1, 2]);
455 456
  });

457 458
  testWidgets('Row with MainAxisAlignment.end - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
459 460 461 462
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
463 464 465

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 100x100 children's left edges should be at 500, 600, 700.
466 467
    await tester.pumpWidget(Center(
      child: Row(
468
        key: rowKey,
469
        textDirection: TextDirection.ltr,
470 471
        mainAxisAlignment: MainAxisAlignment.end,
        children: <Widget>[
472 473 474
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
475 476
        ],
      ),
477 478 479 480 481 482 483 484 485 486 487 488
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
489
    boxParentData = renderBox.parentData as BoxParentData;
490 491 492 493 494
    expect(boxParentData.offset.dx, equals(500.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
495
    boxParentData = renderBox.parentData as BoxParentData;
496 497 498 499 500
    expect(boxParentData.offset.dx, equals(600.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
501
    boxParentData = renderBox.parentData as BoxParentData;
502
    expect(boxParentData.offset.dx, equals(700.0));
503 504

    expect(OrderPainter.log, <int>[1, 2, 3]);
505 506
  });

507 508
  testWidgets('Row with MainAxisAlignment.spaceBetween - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
509 510 511 512
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
513 514 515

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 100x100 children's left edges should be at 0, 350, 700
516 517
    await tester.pumpWidget(Center(
      child: Row(
518 519
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
520
        textDirection: TextDirection.ltr,
521
        children: <Widget>[
522 523 524
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
525 526
        ],
      ),
527 528 529 530 531 532 533 534 535 536 537 538
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
539
    boxParentData = renderBox.parentData as BoxParentData;
540 541 542 543 544
    expect(boxParentData.offset.dx, equals(0.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
545
    boxParentData = renderBox.parentData as BoxParentData;
546 547 548 549 550
    expect(boxParentData.offset.dx, equals(350.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
551
    boxParentData = renderBox.parentData as BoxParentData;
552
    expect(boxParentData.offset.dx, equals(700.0));
553 554

    expect(OrderPainter.log, <int>[1, 2, 3]);
555 556
  });

557 558
  testWidgets('Row with MainAxisAlignment.spaceAround - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
559 560 561 562 563
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
    const Key child3Key = Key('child3');
564 565 566

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 100x100 children's left edges should be at 50, 250, 450, 650
567 568
    await tester.pumpWidget(Center(
      child: Row(
569 570
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceAround,
571
        textDirection: TextDirection.ltr,
572
        children: <Widget>[
573 574 575 576
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
          Container(key: child3Key, width: 100.0, height: 100.0, child: log(4)),
577 578
        ],
      ),
579 580 581 582 583 584 585 586 587 588 589 590
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
591
    boxParentData = renderBox.parentData as BoxParentData;
592 593 594 595 596
    expect(boxParentData.offset.dx, equals(50.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
597
    boxParentData = renderBox.parentData as BoxParentData;
598 599 600 601 602
    expect(boxParentData.offset.dx, equals(250.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
603
    boxParentData = renderBox.parentData as BoxParentData;
604 605 606 607 608
    expect(boxParentData.offset.dx, equals(450.0));

    renderBox = tester.renderObject(find.byKey(child3Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
609
    boxParentData = renderBox.parentData as BoxParentData;
610
    expect(boxParentData.offset.dx, equals(650.0));
611 612

    expect(OrderPainter.log, <int>[1, 2, 3, 4]);
613 614
  });

615 616
  testWidgets('Row with MainAxisAlignment.spaceEvenly - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
617 618 619 620
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
621 622 623

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 200x100 children's left edges should be at 50, 300, 550
624 625
    await tester.pumpWidget(Center(
      child: Row(
626 627
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
628
        textDirection: TextDirection.ltr,
629
        children: <Widget>[
630 631 632
          Container(key: child0Key, width: 200.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 200.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 200.0, height: 100.0, child: log(3)),
633 634
        ],
      ),
635 636 637 638 639 640 641 642 643 644 645 646
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(200.0));
    expect(renderBox.size.height, equals(100.0));
647
    boxParentData = renderBox.parentData as BoxParentData;
648 649 650 651 652
    expect(boxParentData.offset.dx, equals(50.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(200.0));
    expect(renderBox.size.height, equals(100.0));
653
    boxParentData = renderBox.parentData as BoxParentData;
654 655 656 657 658
    expect(boxParentData.offset.dx, equals(300.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(200.0));
    expect(renderBox.size.height, equals(100.0));
659
    boxParentData = renderBox.parentData as BoxParentData;
660
    expect(boxParentData.offset.dx, equals(550.0));
661 662

    expect(OrderPainter.log, <int>[1, 2, 3]);
663 664
  });

665 666
  testWidgets('Row and MainAxisSize.min - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
667 668 669
    const Key rowKey = Key('rowKey');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
670 671 672

    // Row with MainAxisSize.min without flexible children shrink wraps.
    // Row's width should be 250, children should be at 0, 100.
673 674
    await tester.pumpWidget(Center(
      child: Row(
675 676
        key: rowKey,
        mainAxisSize: MainAxisSize.min,
677
        textDirection: TextDirection.ltr,
678
        children: <Widget>[
679 680
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 150.0, height: 100.0, child: log(2)),
681 682
        ],
      ),
683 684 685 686 687 688 689 690 691 692 693 694
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(250.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
695
    boxParentData = renderBox.parentData as BoxParentData;
696 697 698 699 700
    expect(boxParentData.offset.dx, equals(0.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(150.0));
    expect(renderBox.size.height, equals(100.0));
701
    boxParentData = renderBox.parentData as BoxParentData;
702
    expect(boxParentData.offset.dx, equals(100.0));
703 704 705 706 707 708

    expect(OrderPainter.log, <int>[1, 2]);
  });

  testWidgets('Row MainAxisSize.min layout at zero size - LTR', (WidgetTester tester) async {
    OrderPainter.log.clear();
709
    const Key childKey = Key('childKey');
710

711 712
    await tester.pumpWidget(Center(
      child: Container(
713 714
        width: 0.0,
        height: 0.0,
715
        child: Row(
716 717 718 719
          textDirection: TextDirection.ltr,
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
720
            Container(
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739
              key: childKey,
              width: 100.0,
              height: 100.0,
            ),
          ],
        ),
      ),
    ));

    final RenderBox renderBox = tester.renderObject(find.byKey(childKey));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(0.0));
  });


  // RTL

  testWidgets('Row with one Flexible child - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
740 741 742 743
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
744 745 746 747

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // Default is MainAxisAlignment.start so children so the children's
    // right edges should be at 0, 100, 700 from the right, child2's width should be 600
748 749
    await tester.pumpWidget(Center(
      child: Row(
750 751 752
        key: rowKey,
        textDirection: TextDirection.rtl,
        children: <Widget>[
753 754 755
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Expanded(child: Container(key: child1Key, width: 100.0, height: 100.0, child: log(2))),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
756 757 758 759 760 761 762 763 764 765 766 767 768 769
        ],
      ),
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
770
    boxParentData = renderBox.parentData as BoxParentData;
771 772 773 774 775
    expect(boxParentData.offset.dx, equals(700.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(600.0));
    expect(renderBox.size.height, equals(100.0));
776
    boxParentData = renderBox.parentData as BoxParentData;
777 778 779 780 781
    expect(boxParentData.offset.dx, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
782
    boxParentData = renderBox.parentData as BoxParentData;
783 784 785 786 787 788 789
    expect(boxParentData.offset.dx, equals(0.0));

    expect(OrderPainter.log, <int>[1, 2, 3]);
  });

  testWidgets('Row with default main axis parameters - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
790 791 792 793
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
794 795 796 797

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // Default is MainAxisAlignment.start so children so the children's
    // right edges should be at 0, 100, 200 from the right
798 799
    await tester.pumpWidget(Center(
      child: Row(
800 801 802
        key: rowKey,
        textDirection: TextDirection.rtl,
        children: <Widget>[
803 804 805
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
806 807 808 809 810 811 812 813 814 815 816 817 818 819
        ],
      ),
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
820
    boxParentData = renderBox.parentData as BoxParentData;
821 822 823 824 825
    expect(boxParentData.offset.dx, equals(700.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
826
    boxParentData = renderBox.parentData as BoxParentData;
827 828 829 830 831
    expect(boxParentData.offset.dx, equals(600.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
832
    boxParentData = renderBox.parentData as BoxParentData;
833 834 835 836 837 838 839
    expect(boxParentData.offset.dx, equals(500.0));

    expect(OrderPainter.log, <int>[1, 2, 3]);
  });

  testWidgets('Row with MainAxisAlignment.center - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
840 841 842
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
843 844 845

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 100x100 children's right edges should be at 300, 400 from the right
846 847
    await tester.pumpWidget(Center(
      child: Row(
848 849 850 851
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.center,
        textDirection: TextDirection.rtl,
        children: <Widget>[
852 853
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
854 855 856 857 858 859 860 861 862 863 864 865 866 867
        ],
      ),
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
868
    boxParentData = renderBox.parentData as BoxParentData;
869 870 871 872 873
    expect(boxParentData.offset.dx, equals(400.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
874
    boxParentData = renderBox.parentData as BoxParentData;
875 876 877 878 879 880 881
    expect(boxParentData.offset.dx, equals(300.0));

    expect(OrderPainter.log, <int>[1, 2]);
  });

  testWidgets('Row with MainAxisAlignment.end - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
882 883 884 885
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
886 887 888

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 100x100 children's right edges should be at 500, 600, 700 from the right.
889 890
    await tester.pumpWidget(Center(
      child: Row(
891 892 893 894
        key: rowKey,
        textDirection: TextDirection.rtl,
        mainAxisAlignment: MainAxisAlignment.end,
        children: <Widget>[
895 896 897
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
898 899 900 901 902 903 904 905 906 907 908 909 910 911
        ],
      ),
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
912
    boxParentData = renderBox.parentData as BoxParentData;
913 914 915 916 917
    expect(boxParentData.offset.dx, equals(200.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
918
    boxParentData = renderBox.parentData as BoxParentData;
919 920 921 922 923
    expect(boxParentData.offset.dx, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
924
    boxParentData = renderBox.parentData as BoxParentData;
925 926 927 928 929 930 931
    expect(boxParentData.offset.dx, equals(0.0));

    expect(OrderPainter.log, <int>[1, 2, 3]);
  });

  testWidgets('Row with MainAxisAlignment.spaceBetween - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
932 933 934 935
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
936 937 938

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 100x100 children's right edges should be at 0, 350, 700 from the right
939 940
    await tester.pumpWidget(Center(
      child: Row(
941 942 943 944
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        textDirection: TextDirection.rtl,
        children: <Widget>[
945 946 947
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
948 949 950 951 952 953 954 955 956 957 958 959 960 961
        ],
      ),
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
962
    boxParentData = renderBox.parentData as BoxParentData;
963 964 965 966 967
    expect(boxParentData.offset.dx, equals(700.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
968
    boxParentData = renderBox.parentData as BoxParentData;
969 970 971 972 973
    expect(boxParentData.offset.dx, equals(350.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
974
    boxParentData = renderBox.parentData as BoxParentData;
975 976 977 978 979 980 981
    expect(boxParentData.offset.dx, equals(0.0));

    expect(OrderPainter.log, <int>[1, 2, 3]);
  });

  testWidgets('Row with MainAxisAlignment.spaceAround - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
982 983 984 985 986
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
    const Key child3Key = Key('child3');
987 988 989

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 100x100 children's right edges should be at 50, 250, 450, 650 from the right
990 991
    await tester.pumpWidget(Center(
      child: Row(
992 993 994 995
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        textDirection: TextDirection.rtl,
        children: <Widget>[
996 997 998 999
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 100.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 100.0, height: 100.0, child: log(3)),
          Container(key: child3Key, width: 100.0, height: 100.0, child: log(4)),
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
        ],
      ),
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
1014
    boxParentData = renderBox.parentData as BoxParentData;
1015 1016 1017 1018 1019
    expect(boxParentData.offset.dx, equals(650.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
1020
    boxParentData = renderBox.parentData as BoxParentData;
1021 1022 1023 1024 1025
    expect(boxParentData.offset.dx, equals(450.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
1026
    boxParentData = renderBox.parentData as BoxParentData;
1027 1028 1029 1030 1031
    expect(boxParentData.offset.dx, equals(250.0));

    renderBox = tester.renderObject(find.byKey(child3Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
1032
    boxParentData = renderBox.parentData as BoxParentData;
1033 1034 1035 1036 1037 1038 1039
    expect(boxParentData.offset.dx, equals(50.0));

    expect(OrderPainter.log, <int>[1, 2, 3, 4]);
  });

  testWidgets('Row with MainAxisAlignment.spaceEvenly - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
1040 1041 1042 1043
    const Key rowKey = Key('row');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
    const Key child2Key = Key('child2');
1044 1045 1046

    // Default is MainAxisSize.max so the Row should be as wide as the test: 800.
    // The 200x100 children's right edges should be at 50, 300, 550 from the right
1047 1048
    await tester.pumpWidget(Center(
      child: Row(
1049 1050 1051 1052
        key: rowKey,
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        textDirection: TextDirection.rtl,
        children: <Widget>[
1053 1054 1055
          Container(key: child0Key, width: 200.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 200.0, height: 100.0, child: log(2)),
          Container(key: child2Key, width: 200.0, height: 100.0, child: log(3)),
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069
        ],
      ),
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(800.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(200.0));
    expect(renderBox.size.height, equals(100.0));
1070
    boxParentData = renderBox.parentData as BoxParentData;
1071 1072 1073 1074 1075
    expect(boxParentData.offset.dx, equals(550.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(200.0));
    expect(renderBox.size.height, equals(100.0));
1076
    boxParentData = renderBox.parentData as BoxParentData;
1077 1078 1079 1080 1081
    expect(boxParentData.offset.dx, equals(300.0));

    renderBox = tester.renderObject(find.byKey(child2Key));
    expect(renderBox.size.width, equals(200.0));
    expect(renderBox.size.height, equals(100.0));
1082
    boxParentData = renderBox.parentData as BoxParentData;
1083 1084 1085 1086 1087 1088 1089
    expect(boxParentData.offset.dx, equals(50.0));

    expect(OrderPainter.log, <int>[1, 2, 3]);
  });

  testWidgets('Row and MainAxisSize.min - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
1090 1091 1092
    const Key rowKey = Key('rowKey');
    const Key child0Key = Key('child0');
    const Key child1Key = Key('child1');
1093 1094 1095

    // Row with MainAxisSize.min without flexible children shrink wraps.
    // Row's width should be 250, children should be at 0, 100 from right.
1096 1097
    await tester.pumpWidget(Center(
      child: Row(
1098 1099 1100 1101
        key: rowKey,
        mainAxisSize: MainAxisSize.min,
        textDirection: TextDirection.rtl,
        children: <Widget>[
1102 1103
          Container(key: child0Key, width: 100.0, height: 100.0, child: log(1)),
          Container(key: child1Key, width: 150.0, height: 100.0, child: log(2)),
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117
        ],
      ),
    ));

    RenderBox renderBox;
    BoxParentData boxParentData;

    renderBox = tester.renderObject(find.byKey(rowKey));
    expect(renderBox.size.width, equals(250.0));
    expect(renderBox.size.height, equals(100.0));

    renderBox = tester.renderObject(find.byKey(child0Key));
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(100.0));
1118
    boxParentData = renderBox.parentData as BoxParentData;
1119 1120 1121 1122 1123
    expect(boxParentData.offset.dx, equals(150.0));

    renderBox = tester.renderObject(find.byKey(child1Key));
    expect(renderBox.size.width, equals(150.0));
    expect(renderBox.size.height, equals(100.0));
1124
    boxParentData = renderBox.parentData as BoxParentData;
1125 1126 1127
    expect(boxParentData.offset.dx, equals(0.0));

    expect(OrderPainter.log, <int>[1, 2]);
1128 1129
  });

1130 1131
  testWidgets('Row MainAxisSize.min layout at zero size - RTL', (WidgetTester tester) async {
    OrderPainter.log.clear();
1132
    const Key childKey = Key('childKey');
1133

1134 1135
    await tester.pumpWidget(Center(
      child: Container(
1136 1137
        width: 0.0,
        height: 0.0,
1138
        child: Row(
1139 1140 1141
          textDirection: TextDirection.rtl,
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
1142
          children: <Widget>[
1143
            Container(
1144 1145
              key: childKey,
              width: 100.0,
1146 1147
              height: 100.0,
            ),
1148
          ],
1149 1150
        ),
      ),
1151 1152
    ));

1153
    final RenderBox renderBox = tester.renderObject(find.byKey(childKey));
1154 1155 1156 1157
    expect(renderBox.size.width, equals(100.0));
    expect(renderBox.size.height, equals(0.0));
  });
}