Conversation
98e57b5 to
f45ca1a
Compare
Interesting! |
There was a problem hiding this comment.
I tend to use longer names for these (e.g., mainAxisExtent and crossAxisExtent), but I can see the argument for using these shorter names. I'm not sure how consistent we want to be.
There was a problem hiding this comment.
I'm happy to use the longer names. done.
There was a problem hiding this comment.
We should probably count down and throw an exception if we spin this loop more than, for example, 10 times.
There was a problem hiding this comment.
I didn't understand this description. Which line? Maybe add an example?
There was a problem hiding this comment.
Fixed along with the previous one.
There was a problem hiding this comment.
Looking at the call site, I see that this function is converting the given parentMainAxisPosition into the coordinate system of the child.
There was a problem hiding this comment.
I'd put the up and left cases closer to see the parallelism
There was a problem hiding this comment.
reordered down,right,up,left
There was a problem hiding this comment.
Why not just mainAxisExtent or extent?
There was a problem hiding this comment.
Why a function rather than a getter?
There was a problem hiding this comment.
because one of its implementation is O(N) and our design guide says to use methods for expensive getters.
There was a problem hiding this comment.
This sounds like it's going to apply a label to a child rather then get a label for the child. Maybe labelForChild ?
There was a problem hiding this comment.
I'd move up and left to be next to each other to show parallelism
There was a problem hiding this comment.
same comment about this name.
There was a problem hiding this comment.
I wasn't expecting this function to call markNeedsLayout based on the name... Maybe have this function return a bool and have the caller call markNeedsLayout?
There was a problem hiding this comment.
I generally prefer while (true) { ... } infinite loops, but maybe that's not in the style guide (yet).
There was a problem hiding this comment.
I really wish Dart had a loop construct that had the following structure:
loop {
...;
break here when (condition);
...;
}There was a problem hiding this comment.
size = new Size(constraints.maxWidth, constraints.minHeight) seems more straightforward.
There was a problem hiding this comment.
Should we have this assert in the "no children" case?
There was a problem hiding this comment.
I see, this is why you're calling it effectiveExtent in rereportDimensions
There was a problem hiding this comment.
I'm surprised that we don't have a version of constrain that takes the width and height separately. Might be worth adding to avoid the extra Size allocation.
There was a problem hiding this comment.
Added BoxConstraints.constrainDimensions.
There was a problem hiding this comment.
If this is a member, we don't need to pass the scrollDirection
There was a problem hiding this comment.
We've been using .. in updateRenderObject functions because it's slightly more efficient and these functions are super hot.
There was a problem hiding this comment.
Maybe file a bug on me so we don't forget?
There was a problem hiding this comment.
I was cleverer. It'll come up when we try to delete the old class names.
There was a problem hiding this comment.
I'm slightly suspicious of wanting this in tests but not in real apps, but I guess we'll see.
There was a problem hiding this comment.
I was just too lazy to convert the call sites. :-)

Also: