@@ -336,8 +336,8 @@ void main() {
336
336
});
337
337
338
338
test ('UnconstrainedBox expands to fit children' , () {
339
- final RenderUnconstrainedBox unconstrained = RenderUnconstrainedBox (
340
- constrainedAxis : Axis .horizontal, // This is reset to null below.
339
+ final RenderConstraintsTransformBox unconstrained = RenderConstraintsTransformBox (
340
+ constraintsTransform : ConstraintsTransformBox .widthUnconstrained,
341
341
textDirection: TextDirection .ltr,
342
342
child: RenderConstrainedBox (
343
343
additionalConstraints: const BoxConstraints .tightFor (width: 200.0 , height: 200.0 ),
@@ -354,15 +354,16 @@ void main() {
354
354
),
355
355
);
356
356
// Check that we can update the constrained axis to null.
357
- unconstrained.constrainedAxis = null ;
357
+ unconstrained.constraintsTransform = ConstraintsTransformBox .unconstrained ;
358
358
TestRenderingFlutterBinding .instance.reassembleApplication ();
359
359
360
360
expect (unconstrained.size.width, equals (200.0 ), reason: 'unconstrained width' );
361
361
expect (unconstrained.size.height, equals (200.0 ), reason: 'unconstrained height' );
362
362
});
363
363
364
364
test ('UnconstrainedBox handles vertical overflow' , () {
365
- final RenderUnconstrainedBox unconstrained = RenderUnconstrainedBox (
365
+ final RenderConstraintsTransformBox unconstrained = RenderConstraintsTransformBox (
366
+ constraintsTransform: ConstraintsTransformBox .unconstrained,
366
367
textDirection: TextDirection .ltr,
367
368
child: RenderConstrainedBox (
368
369
additionalConstraints: const BoxConstraints .tightFor (height: 200.0 ),
@@ -378,7 +379,8 @@ void main() {
378
379
});
379
380
380
381
test ('UnconstrainedBox handles horizontal overflow' , () {
381
- final RenderUnconstrainedBox unconstrained = RenderUnconstrainedBox (
382
+ final RenderConstraintsTransformBox unconstrained = RenderConstraintsTransformBox (
383
+ constraintsTransform: ConstraintsTransformBox .unconstrained,
382
384
textDirection: TextDirection .ltr,
383
385
child: RenderConstrainedBox (
384
386
additionalConstraints: const BoxConstraints .tightFor (width: 200.0 ),
@@ -508,7 +510,8 @@ void main() {
508
510
});
509
511
510
512
test ('getMinIntrinsicWidth error handling' , () {
511
- final RenderUnconstrainedBox unconstrained = RenderUnconstrainedBox (
513
+ final RenderConstraintsTransformBox unconstrained = RenderConstraintsTransformBox (
514
+ constraintsTransform: ConstraintsTransformBox .unconstrained,
512
515
textDirection: TextDirection .ltr,
513
516
child: RenderConstrainedBox (
514
517
additionalConstraints: const BoxConstraints .tightFor (width: 200.0 ),
@@ -632,7 +635,8 @@ void main() {
632
635
});
633
636
634
637
test ('UnconstrainedBox.toStringDeep returns useful information' , () {
635
- final RenderUnconstrainedBox unconstrained = RenderUnconstrainedBox (
638
+ final RenderConstraintsTransformBox unconstrained = RenderConstraintsTransformBox (
639
+ constraintsTransform: ConstraintsTransformBox .unconstrained,
636
640
textDirection: TextDirection .ltr,
637
641
alignment: Alignment .center,
638
642
);
@@ -642,7 +646,7 @@ void main() {
642
646
expect (
643
647
unconstrained.toStringDeep (minLevel: DiagnosticLevel .info),
644
648
equalsIgnoringHashCodes (
645
- 'RenderUnconstrainedBox #00000 NEEDS-LAYOUT NEEDS-PAINT DETACHED\n '
649
+ 'RenderConstraintsTransformBox #00000 NEEDS-LAYOUT NEEDS-PAINT DETACHED\n '
646
650
' parentData: MISSING\n '
647
651
' constraints: MISSING\n '
648
652
' size: MISSING\n '
@@ -655,8 +659,8 @@ void main() {
655
659
test ('UnconstrainedBox honors constrainedAxis=Axis.horizontal' , () {
656
660
final RenderConstrainedBox flexible =
657
661
RenderConstrainedBox (additionalConstraints: const BoxConstraints .expand (height: 200.0 ));
658
- final RenderUnconstrainedBox unconstrained = RenderUnconstrainedBox (
659
- constrainedAxis : Axis .horizontal ,
662
+ final RenderConstraintsTransformBox unconstrained = RenderConstraintsTransformBox (
663
+ constraintsTransform : ConstraintsTransformBox .heightUnconstrained ,
660
664
textDirection: TextDirection .ltr,
661
665
child: RenderFlex (
662
666
textDirection: TextDirection .ltr,
@@ -678,8 +682,8 @@ void main() {
678
682
test ('UnconstrainedBox honors constrainedAxis=Axis.vertical' , () {
679
683
final RenderConstrainedBox flexible =
680
684
RenderConstrainedBox (additionalConstraints: const BoxConstraints .expand (width: 200.0 ));
681
- final RenderUnconstrainedBox unconstrained = RenderUnconstrainedBox (
682
- constrainedAxis : Axis .vertical ,
685
+ final RenderConstraintsTransformBox unconstrained = RenderConstraintsTransformBox (
686
+ constraintsTransform : ConstraintsTransformBox .widthUnconstrained ,
683
687
textDirection: TextDirection .ltr,
684
688
child: RenderFlex (
685
689
direction: Axis .vertical,
@@ -710,21 +714,23 @@ void main() {
710
714
}
711
715
712
716
for (final Clip ? clip in < Clip ? > [null , ...Clip .values]) {
713
- final RenderUnconstrainedBox box;
717
+ final RenderConstraintsTransformBox box;
714
718
switch (clip) {
715
719
case Clip .none:
716
720
case Clip .hardEdge:
717
721
case Clip .antiAlias:
718
722
case Clip .antiAliasWithSaveLayer:
719
- box = RenderUnconstrainedBox (
723
+ box = RenderConstraintsTransformBox (
724
+ constraintsTransform: ConstraintsTransformBox .unconstrained,
720
725
alignment: Alignment .center,
721
726
textDirection: TextDirection .ltr,
722
727
child: box200x200,
723
728
clipBehavior: clip! ,
724
729
);
725
730
break ;
726
731
case null :
727
- box = RenderUnconstrainedBox (
732
+ box = RenderConstraintsTransformBox (
733
+ constraintsTransform: ConstraintsTransformBox .unconstrained,
728
734
alignment: Alignment .center,
729
735
textDirection: TextDirection .ltr,
730
736
child: box200x200,
0 commit comments