Skip to content

[two_dimensional_scrollables/TableView] There's no way to set horizontal/vertical alignment if table fits within view. #170349

Description

@modulovalue

Use case

This issue is about two_dimensional_scrollables in particular the TableView implementation.

Consider the following example: https://github.com/flutter/packages/blob/main/packages/two_dimensional_scrollables/example/lib/table_view/merged_table.dart

After running it we get something like the following:

Image Image

Notice that the table does not have enough content to overflow, it fits inside the view on the horizontal axis, but it is not centered and there seems to be no way to center it.

This seems to be due to TableView automatically being laid out top & left when there's no overflow.

It doesn't seem to be possible to center TableView with traditional Alignment based tactics (Row/Column/Center), because its height and width and infinite.

Proposal

What I was looking for is a property like HorizontalAxisAlignment/VerticalAxisAlignment (similar to the MainAxisAlignment of Flex) that allows me to change the default from .start to .center.

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectp: two_dimensional_scrollablesIssues pertaining to the two_dimensional_scrollables packagepackageflutter/packages repository. See also p: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions