-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: layoutSystemChrome and Framework's Layout IssuesSystemChrome and Framework's Layout Issuesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
VerticalDirection.up reorders its children. This will be a breaking change.
test('Vertical Flex Baseline', () {
const BoxConstraints square = BoxConstraints.tightFor(width: 100.0, height: 100.0);
final RenderConstrainedBox box1 = RenderConstrainedBox(
additionalConstraints: square,
child: RenderFlowBaselineTestBox()
..gridCount = 1
..baselinePlacer = (double height) => 10,
);
final RenderConstrainedBox box2 = RenderConstrainedBox(
additionalConstraints: square,
child: RenderFlowBaselineTestBox()
..gridCount = 1
..baselinePlacer = (double height) => 10,
);
final RenderFlex flex = RenderFlex(
textDirection: TextDirection.ltr,
children: <RenderBox>[box1, box2],
direction: Axis.vertical,
);
layout(flex, phase: EnginePhase.paint);
// We can't call the getDistanceToBaseline method directly. Check the dry
// baseline instead, and in debug mode there are asserts that verify
// the two methods return the same results.
expect(flex.getDryBaseline(flex.constraints, TextBaseline.alphabetic), 10);
flex.mainAxisAlignment = MainAxisAlignment.end;
pumpFrame(phase: EnginePhase.paint);
expect(flex.getDryBaseline(flex.constraints, TextBaseline.alphabetic), 410);
flex.verticalDirection = VerticalDirection.up;
pumpFrame(phase: EnginePhase.paint);
expect(flex.getDryBaseline(flex.constraints, TextBaseline.alphabetic), 10);
flex.mainAxisAlignment = MainAxisAlignment.start;
pumpFrame(phase: EnginePhase.paint);
expect(flex.getDryBaseline(flex.constraints, TextBaseline.alphabetic), 410);
});Metadata
Metadata
Assignees
Labels
a: layoutSystemChrome and Framework's Layout IssuesSystemChrome and Framework's Layout Issuesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.