mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Issues/58053 - Set default textBaseline to alphabetic in the Table widget (#60586)
This commit is contained in:
parent
de205ec13c
commit
60deae8546
1
AUTHORS
1
AUTHORS
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user