@@ -2357,7 +2357,7 @@ class _ConstraintRenderBox extends RenderBox
2357
2357
child = childParentData.nextSibling;
2358
2358
}
2359
2359
2360
- parentNode.depth = childCount;
2360
+ parentNode.depth = childCount + 1 ;
2361
2361
2362
2362
return nodesMap;
2363
2363
}
@@ -2741,13 +2741,13 @@ class _ConstraintRenderBox extends RenderBox
2741
2741
if (element.leftAlignType == _AlignType .left) {
2742
2742
left = element.leftConstraint! .getX ();
2743
2743
} else {
2744
- left = element.leftConstraint! .getRight (size );
2744
+ left = element.leftConstraint! .getRight (this );
2745
2745
}
2746
2746
double right;
2747
2747
if (element.rightAlignType == _AlignType .left) {
2748
2748
right = element.rightConstraint! .getX ();
2749
2749
} else {
2750
- right = element.rightConstraint! .getRight (size );
2750
+ right = element.rightConstraint! .getRight (this );
2751
2751
}
2752
2752
double leftMargin;
2753
2753
if (element.leftConstraint! .notLaidOut) {
@@ -2829,13 +2829,13 @@ class _ConstraintRenderBox extends RenderBox
2829
2829
if (element.topAlignType == _AlignType .top) {
2830
2830
top = element.topConstraint! .getY ();
2831
2831
} else {
2832
- top = element.topConstraint! .getBottom (size );
2832
+ top = element.topConstraint! .getBottom (this );
2833
2833
}
2834
2834
double bottom;
2835
2835
if (element.bottomAlignType == _AlignType .top) {
2836
2836
bottom = element.bottomConstraint! .getY ();
2837
2837
} else {
2838
- bottom = element.bottomConstraint! .getBottom (size );
2838
+ bottom = element.bottomConstraint! .getBottom (this );
2839
2839
}
2840
2840
double topMargin;
2841
2841
if (element.topConstraint! .notLaidOut) {
@@ -2956,9 +2956,9 @@ class _ConstraintRenderBox extends RenderBox
2956
2956
} else if (direction == BarrierDirection .top) {
2957
2957
list.add (node.parentData._constrainedNodeMap[id]! .getY ());
2958
2958
} else if (direction == BarrierDirection .right) {
2959
- list.add (node.parentData._constrainedNodeMap[id]! .getRight (size ));
2959
+ list.add (node.parentData._constrainedNodeMap[id]! .getRight ());
2960
2960
} else {
2961
- list.add (node.parentData._constrainedNodeMap[id]! .getBottom (size ));
2961
+ list.add (node.parentData._constrainedNodeMap[id]! .getBottom ());
2962
2962
}
2963
2963
}
2964
2964
list.sort ((left, right) {
@@ -2990,13 +2990,13 @@ class _ConstraintRenderBox extends RenderBox
2990
2990
if (node.leftAlignType == _AlignType .left) {
2991
2991
left = node.leftConstraint! .getX ();
2992
2992
} else {
2993
- left = node.leftConstraint! .getRight (size );
2993
+ left = node.leftConstraint! .getRight (this );
2994
2994
}
2995
2995
double right;
2996
2996
if (node.rightAlignType == _AlignType .left) {
2997
2997
right = node.rightConstraint! .getX ();
2998
2998
} else {
2999
- right = node.rightConstraint! .getRight (size );
2999
+ right = node.rightConstraint! .getRight (this );
3000
3000
}
3001
3001
double leftMargin;
3002
3002
if (node.leftConstraint! .notLaidOut) {
@@ -3027,7 +3027,7 @@ class _ConstraintRenderBox extends RenderBox
3027
3027
if (node.leftAlignType == _AlignType .left) {
3028
3028
left = node.leftConstraint! .getX ();
3029
3029
} else {
3030
- left = node.leftConstraint! .getRight (size );
3030
+ left = node.leftConstraint! .getRight (this );
3031
3031
}
3032
3032
if (node.leftConstraint! .notLaidOut) {
3033
3033
left += _getLeftInsets (goneMargin, node.percentageMargin, size.width);
@@ -3040,7 +3040,7 @@ class _ConstraintRenderBox extends RenderBox
3040
3040
if (node.rightAlignType == _AlignType .left) {
3041
3041
right = node.rightConstraint! .getX ();
3042
3042
} else {
3043
- right = node.rightConstraint! .getRight (size );
3043
+ right = node.rightConstraint! .getRight (this );
3044
3044
}
3045
3045
if (node.rightConstraint! .notLaidOut) {
3046
3046
right -=
@@ -3059,13 +3059,13 @@ class _ConstraintRenderBox extends RenderBox
3059
3059
if (node.topAlignType == _AlignType .top) {
3060
3060
top = node.topConstraint! .getY ();
3061
3061
} else {
3062
- top = node.topConstraint! .getBottom (size );
3062
+ top = node.topConstraint! .getBottom (this );
3063
3063
}
3064
3064
double bottom;
3065
3065
if (node.bottomAlignType == _AlignType .top) {
3066
3066
bottom = node.bottomConstraint! .getY ();
3067
3067
} else {
3068
- bottom = node.bottomConstraint! .getBottom (size );
3068
+ bottom = node.bottomConstraint! .getBottom (this );
3069
3069
}
3070
3070
double topMargin;
3071
3071
if (node.topConstraint! .notLaidOut) {
@@ -3096,7 +3096,7 @@ class _ConstraintRenderBox extends RenderBox
3096
3096
if (node.topAlignType == _AlignType .top) {
3097
3097
top = node.topConstraint! .getY ();
3098
3098
} else {
3099
- top = node.topConstraint! .getBottom (size );
3099
+ top = node.topConstraint! .getBottom (this );
3100
3100
}
3101
3101
if (node.topConstraint! .notLaidOut) {
3102
3102
top += _getTopInsets (goneMargin, node.percentageMargin, size.height);
@@ -3109,7 +3109,7 @@ class _ConstraintRenderBox extends RenderBox
3109
3109
if (node.bottomAlignType == _AlignType .top) {
3110
3110
bottom = node.bottomConstraint! .getY ();
3111
3111
} else {
3112
- bottom = node.bottomConstraint! .getBottom (size );
3112
+ bottom = node.bottomConstraint! .getBottom (this );
3113
3113
}
3114
3114
if (node.bottomConstraint! .notLaidOut) {
3115
3115
bottom -=
@@ -3124,7 +3124,7 @@ class _ConstraintRenderBox extends RenderBox
3124
3124
offsetY = node.baselineConstraint! .getY () -
3125
3125
node.getDistanceToBaseline (node.textBaseline, false );
3126
3126
} else if (node.baselineAlignType == _AlignType .bottom) {
3127
- offsetY = node.baselineConstraint! .getBottom (size ) -
3127
+ offsetY = node.baselineConstraint! .getBottom (this ) -
3128
3128
node.getDistanceToBaseline (node.textBaseline, false );
3129
3129
} else {
3130
3130
offsetY = node.baselineConstraint!
@@ -3585,16 +3585,16 @@ class _ConstrainedNode {
3585
3585
return offset.dy;
3586
3586
}
3587
3587
3588
- double getRight ([Size ? size ]) {
3588
+ double getRight ([RenderBox ? parent ]) {
3589
3589
if (isParent ()) {
3590
- return size ! .width;
3590
+ return parent ! .size .width;
3591
3591
}
3592
3592
return getX () + getMeasuredWidth ();
3593
3593
}
3594
3594
3595
- double getBottom ([Size ? size ]) {
3595
+ double getBottom ([RenderBox ? parent ]) {
3596
3596
if (isParent ()) {
3597
- return size ! .height;
3597
+ return parent ! .size .height;
3598
3598
}
3599
3599
return getY () + getMeasuredHeight ();
3600
3600
}
@@ -4163,14 +4163,10 @@ class _BarrierRenderBox extends _HelperBox {
4163
4163
constraintBoxData._referencedIds = referencedIds;
4164
4164
if (direction == BarrierDirection .top ||
4165
4165
direction == BarrierDirection .bottom) {
4166
- constraintBoxData.width = matchParent;
4167
- constraintBoxData.height = 0 ;
4168
4166
constraintBoxData.top = parent.top;
4169
4167
constraintBoxData.left = parent.left;
4170
4168
constraintBoxData.right = parent.right;
4171
4169
} else {
4172
- constraintBoxData.width = 0 ;
4173
- constraintBoxData.height = matchParent;
4174
4170
constraintBoxData.left = parent.left;
4175
4171
constraintBoxData.top = parent.top;
4176
4172
constraintBoxData.bottom = parent.bottom;
0 commit comments