Skip to content

Auto height error in Table Widget: row gets zero height when all cells use TableCellVerticalAlignment.fill #130261

@gbtb16

Description

@gbtb16

Is there an existing issue for this?

Steps to reproduce

  1. Create a table widget.
  2. Add children (TableRow and TableCell).
  3. Set the default vertical alignment as TableCellVerticalAlignment.fill (will be used automatically in all cells).

Expected results

All rows should have automatic height with cell filling.
Cell filling means automatically filling the height of all rows and not knowing which cell has the most height.

Actual results

When TableCellVerticalAlignment.fill is used by all cells, the row height becomes zero height.

Code sample

Code sample
return Table(
      children: [
        TableRow(
          children: [
            TableCell(child: Text('First Column')),
            TableCell(child: Text('Second Column')),
          ],
        ),
        TableRow(
          children: [
            TableCell(child: Text('First Cell')),
            TableCell(child: Text('Second Cell')),
          ],
        ),
      ],
      defaultVerticalAlignment: TableCellVerticalAlignment.fill,
      columnWidths: {
        0: FlexColumnWidth(),
        1: FlexColumnWidth(),
      },
    );

Screenshots or Video

Screenshots / Video demonstration

Expected (using all .fill and not .middle):
image

Actual:
image

In the enum TableCellVerticalAlignment has exactly the description of zero height when used fill for all cells:
image

Logs

Logs
Reloaded 1 of 1937 libraries in 383ms (compile: 48 ms, reload: 117 ms, reassemble: 128 ms).

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [versÆo 10.0.19045.3086],    locale pt-BR)
    • Flutter version 3.10.5 on channel stable at C:\src\flutter
    • Upstream repository [email protected]:flutter/flutter.git
    • Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700       
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\gabriel.barbosa\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)   
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.6.2)      
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community     
    • Visual Studio Community 2022 version 17.6.33723.286
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)   

[√] VS Code (version 1.80.0)
    • VS Code at C:\Users\gabriel.barbosa\AppData\Local\Programs\Microsoft VS Code 
    • Flutter extension version 3.68.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [versÆo     
      10.0.19045.3086]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 113.0.5672.127  
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 114.0.1823.67  

[√] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 3.10Found to occur in 3.10found in release: 3.12Found to occur in 3.12frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions