Unverified Commit 3ce06efd authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Default textBaseline to alphabetic in Flex (#61425)

parent f25bd9c5
...@@ -3871,7 +3871,7 @@ class Flex extends MultiChildRenderObjectWidget { ...@@ -3871,7 +3871,7 @@ class Flex extends MultiChildRenderObjectWidget {
this.crossAxisAlignment = CrossAxisAlignment.center, this.crossAxisAlignment = CrossAxisAlignment.center,
this.textDirection, this.textDirection,
this.verticalDirection = VerticalDirection.down, this.verticalDirection = VerticalDirection.down,
this.textBaseline, this.textBaseline = TextBaseline.alphabetic,
this.clipBehavior = Clip.hardEdge, this.clipBehavior = Clip.hardEdge,
List<Widget> children = const <Widget>[], List<Widget> children = const <Widget>[],
}) : assert(direction != null), }) : assert(direction != null),
...@@ -3963,6 +3963,8 @@ class Flex extends MultiChildRenderObjectWidget { ...@@ -3963,6 +3963,8 @@ class Flex extends MultiChildRenderObjectWidget {
final VerticalDirection verticalDirection; final VerticalDirection verticalDirection;
/// If aligning items according to their baseline, which baseline to use. /// If aligning items according to their baseline, which baseline to use.
///
/// Defaults to [TextBaseline.alphabetic].
final TextBaseline textBaseline; final TextBaseline textBaseline;
// TODO(liyuqian): defaults to [Clip.none] once Google references are updated. // TODO(liyuqian): defaults to [Clip.none] once Google references are updated.
...@@ -4219,7 +4221,7 @@ class Row extends Flex { ...@@ -4219,7 +4221,7 @@ class Row extends Flex {
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
TextDirection textDirection, TextDirection textDirection,
VerticalDirection verticalDirection = VerticalDirection.down, VerticalDirection verticalDirection = VerticalDirection.down,
TextBaseline textBaseline, TextBaseline textBaseline = TextBaseline.alphabetic,
List<Widget> children = const <Widget>[], List<Widget> children = const <Widget>[],
}) : super( }) : super(
children: children, children: children,
......
...@@ -34,8 +34,8 @@ void main() { ...@@ -34,8 +34,8 @@ void main() {
' If multiple keyed nodes exist as children of another node, they\n' ' If multiple keyed nodes exist as children of another node, they\n'
' must have unique keys.\n' ' must have unique keys.\n'
' Flex(direction: vertical, mainAxisAlignment: start,\n' ' Flex(direction: vertical, mainAxisAlignment: start,\n'
' crossAxisAlignment: center) has multiple children with key\n' ' crossAxisAlignment: center, textBaseline: alphabetic) has\n'
" [<'key'>].\n", " multiple children with key [<'key'>].\n",
), ),
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment