Unverified Commit 60deae85 authored by Ram Navan's avatar Ram Navan Committed by GitHub

Issues/58053 - Set default textBaseline to alphabetic in the Table widget (#60586)

parent de205ec1
......@@ -63,3 +63,4 @@ Brian Wang <xinlei966@gmail.com>
法的空间 <zmtzawqlp@live.com>
CaiJingLong <cjl_spy@163.com>
Alex Li <google@alexv525.com>
Ram Navan <hiramprasad@gmail.com>
......@@ -109,7 +109,7 @@ class Table extends RenderObjectWidget {
this.textDirection,
this.border,
this.defaultVerticalAlignment = TableCellVerticalAlignment.top,
this.textBaseline,
this.textBaseline = TextBaseline.alphabetic,
}) : assert(children != null),
assert(defaultColumnWidth != null),
assert(defaultVerticalAlignment != null),
......@@ -201,6 +201,8 @@ class Table extends RenderObjectWidget {
final TableCellVerticalAlignment defaultVerticalAlignment;
/// The text baseline to use when aligning rows using [TableCellVerticalAlignment.baseline].
///
/// Defaults to [TextBaseline.alphabetic].
final TextBaseline textBaseline;
final List<Decoration> _rowDecorations;
......
......@@ -932,5 +932,29 @@ void main() {
},
);
testWidgets(
'Table widget - Default textBaseline is set to TableBaseline.alphabetic',
(WidgetTester tester) async {
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: Table(
defaultVerticalAlignment: TableCellVerticalAlignment.baseline,
children: const <TableRow>[
TableRow(
children: <Widget>[
Text('Some Text'),
],
),
],
),
),
);
final RenderTable table = tester.renderObject(find.byType(Table));
expect(table.textBaseline, TextBaseline.alphabetic);
},
);
// TODO(ianh): Test handling of TableCell object
}
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