Skip to content

Conversation

@gbtb16
Copy link
Contributor

@gbtb16 gbtb16 commented Jul 10, 2023

What has been done?

Added new enumeration in TableCellVerticalAlignment, which sets the cell size to the same as the topmost cell. There are no noticeable problems in using it in all cells together, as there are in TableCellVerticalAlignment.fill which is made not to be used in all cells together because it has another purpose.

Explanation of the logic

An assignment was made (which already existed in TableCellVerticalAlignment.top; middle and bottom) that assigns rowHeight the maximum double between the initialized height and the height of its child.

image

Basically, defining a minimum cell height based on its child, and letting each table row have its own height stipulated from the largest element, creating an IntrinsicHeight for TableCell automatically.

image

As the TableCellVerticalAlignment logic already provides for the use of the height of the largest cell in the row, it was possible to reuse this logic, and just not make the break statement that exists to fill in the calculation for intrinsicHeight.

Real example in an Android application after added enumeration

image

Opened issue

FIX: #130261

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@google-cla
Copy link

google-cla bot commented Jul 10, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 10, 2023
@LucienCorreia
Copy link

:shipit:

@gbtb16 gbtb16 marked this pull request as draft July 10, 2023 14:13
@itbrunoms
Copy link

Congratulations

@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@gbtb16 gbtb16 marked this pull request as ready for review July 10, 2023 15:26
@goderbauer goderbauer requested a review from Piinks July 11, 2023 22:20
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gbtb16! Welcome, thank you for contributing!

based on assignment made previously to TableCellVerticalAlignment.top, TableCellVerticalAlignment.middle & TableCellVerticalAlignment.bottom.

Why use these alignments when a different one has been specified?

creating an IntrinsicHeight type for TableCell automatically.

This is very expensive and I am not sure it is the expected behavior that already exists.

Do we need a different TableCellVerticalAlignment? I don't know that we can change this pre-existing behavior on users that are already using it.

@gbtb16 gbtb16 marked this pull request as draft August 4, 2023 18:03
@goderbauer
Copy link
Member

@gbtb16 (Triage) Do you still have plans to follow up on the feedback given here in the near future?

@gbtb16
Copy link
Contributor Author

gbtb16 commented Aug 28, 2023

Yes, I did working about a new solution to this issue. Thanks for remember that, @goderbauer.

@Piinks
Copy link
Contributor

Piinks commented Sep 11, 2023

Hey @gbtb16 since you mentioned working on a new PR for this, I am going to close this for now to remove it from our review queue. If you would like to push the new changes here, feel free to reopen when it is ready for a look. Thanks very much for contributing!

@Piinks Piinks closed this Sep 11, 2023
@gbtb16
Copy link
Contributor Author

gbtb16 commented Nov 6, 2023

Hi @Piinks and @goderbauer! I applied new changes to this PR that you asked me to do. Can someone reopen the PR please?

@Piinks
Copy link
Contributor

Piinks commented Nov 6, 2023

Sure! Thanks for the update.

@gbtb16 gbtb16 requested a review from Piinks November 14, 2023 12:34
@juarezfranco
Copy link

:shipit:

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flutter_LGTM

Thank you for the contribution!

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@LucienCorreia
Copy link

image
:shipit:

@juarezfranco
Copy link

image
:shipit:

@itbrunoms
Copy link

Captura de tela de 2023-11-22 08-26-43

@gbtb16 gbtb16 changed the title feature(table-widget): Added intrisicHeight to TableCellVerticalAlignment enum. feature(table-widget): Added intrinsicHeight to TableCellVerticalAlignment enum. Nov 22, 2023
@pepefcardoso
Copy link

image

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 27, 2023
@auto-submit auto-submit bot merged commit 66935a8 into flutter:master Nov 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 29, 2023
Roll Flutter from 6bf3ccd to 5e5b529 (58 revisions)

flutter/flutter@6bf3ccd...5e5b529

2023-11-29 [email protected] Roll Flutter Engine from 60b963930202 to 222beb28a8eb (2 revisions) (flutter/flutter#139242)
2023-11-29 [email protected] Roll Flutter Engine from eebbe7e15c7d to 60b963930202 (2 revisions) (flutter/flutter#139237)
2023-11-29 [email protected] Roll Packages from 3c05466 to e4aaba8 (5 revisions) (flutter/flutter#139232)
2023-11-29 [email protected] Update VelocityTracker (4) (flutter/flutter#139166)
2023-11-29 [email protected] Analyze against using Stopwatches in the framework (flutter/flutter#138507)
2023-11-29 [email protected] Roll Flutter Engine from ecc9c7b6be7d to eebbe7e15c7d (1 revision) (flutter/flutter#139225)
2023-11-29 [email protected] Roll Flutter Engine from 28aae2d29822 to ecc9c7b6be7d (1 revision) (flutter/flutter#139210)
2023-11-29 [email protected] Improve documentation of CardTheme.shape (flutter/flutter#139096)
2023-11-29 [email protected] Simplify devicelab logic and fix tests (flutter/flutter#139122)
2023-11-29 [email protected] implemented leadingWidth and automaticallyImplyLeading options  (flutter/flutter#136165)
2023-11-29 [email protected] TextField and TextFormField can use a MaterialStatesController (flutter/flutter#133977)
2023-11-29 [email protected] Provide parameter to Icon and IconThemeData for they to consider the context's text scaler (flutter/flutter#135708)
2023-11-29 [email protected] Roll Flutter Engine from be4d7c8b760c to 28aae2d29822 (1 revision) (flutter/flutter#139204)
2023-11-29 [email protected] Update `ButtonStyleButton.scaledPadding` documentation. Migrate callers in flutter/flutter (flutter/flutter#139014)
2023-11-29 [email protected] Roll Flutter Engine from de99c71c598f to be4d7c8b760c (1 revision) (flutter/flutter#139199)
2023-11-29 [email protected] Roll Flutter Engine from 9a840e8dba40 to de99c71c598f (2 revisions) (flutter/flutter#139195)
2023-11-29 [email protected] Roll Flutter Engine from fbb2b1e880fa to 9a840e8dba40 (1 revision) (flutter/flutter#139192)
2023-11-29 [email protected] Roll Flutter Engine from 4beaa1195b74 to fbb2b1e880fa (1 revision) (flutter/flutter#139191)
2023-11-29 [email protected] Roll Flutter Engine from 570fec4fa92c to 4beaa1195b74 (3 revisions) (flutter/flutter#139190)
2023-11-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland Add platform view wide gamut test" (flutter/flutter#139189)
2023-11-28 [email protected] Move analysis test to shard tests. (flutter/flutter#139161)
2023-11-28 [email protected] Write Tests for API Examples of `snack_bar.0`, `elevated_button.0`, `stepper.0`, `radio.0`, `filled_button.0`, `outlined_button.0` & `card.0` (flutter/flutter#138987)
2023-11-28 [email protected] Implement `switch` expressions in `dev/` (flutter/flutter#139048)
2023-11-28 [email protected] Roll Flutter Engine from 01fcec7214db to 570fec4fa92c (2 revisions) (flutter/flutter#139178)
2023-11-28 [email protected] Fix comment (flutter/flutter#138973)
2023-11-28 [email protected] Added some documentation for OverlayPortal (flutter/flutter#138934)
2023-11-28 [email protected] feature(table-widget): Added intrinsicHeight to TableCellVerticalAlignment enum. (flutter/flutter#130264)
2023-11-28 [email protected] Roll Flutter Engine from 97ede154dcd8 to 01fcec7214db (1 revision) (flutter/flutter#139172)
2023-11-28 [email protected] Ensure Icon vertically centers its icon glyph. (flutter/flutter#138937)
2023-11-28 [email protected] Roll Flutter Engine from fd3a33f8b239 to 97ede154dcd8 (2 revisions) (flutter/flutter#139168)
2023-11-28 [email protected] Roll Flutter Engine from d375d5b95d59 to fd3a33f8b239 (2 revisions) (flutter/flutter#139163)
2023-11-28 [email protected] Roll Flutter Engine from e4b18fa3661e to d375d5b95d59 (2 revisions) (flutter/flutter#139157)
2023-11-28 [email protected] Added keyboardType & textInputAction props to SearchBar, SearchAnchor & SearchAnchor.bar (flutter/flutter#138553)
2023-11-28 [email protected] Fix header formatting typo in PopupMenuButton docs (flutter/flutter#139084)
2023-11-28 [email protected] Fix turbulence seed for all tests with ink sparkles (flutter/flutter#138757)
2023-11-28 [email protected] Renable macOS 13 tests (flutter/flutter#139083)
2023-11-28 [email protected] Roll Flutter Engine from 8715e9b9119d to e4b18fa3661e (1 revision) (flutter/flutter#139142)
2023-11-28 [email protected] Roll Packages from e774e88 to 3c05466 (2 revisions) (flutter/flutter#139140)
2023-11-28 [email protected] Roll Flutter Engine from 6ad827e9a71b to 8715e9b9119d (1 revision) (flutter/flutter#139136)
2023-11-28 [email protected] Roll Flutter Engine from c18d3df967dc to 6ad827e9a71b (1 revision) (flutter/flutter#139135)
2023-11-28 [email protected] Roll Flutter Engine from 1caa7478db0d to c18d3df967dc (1 revision) (flutter/flutter#139133)
2023-11-28 [email protected] Roll Flutter Engine from 4f217e1f9afe to 1caa7478db0d (1 revision) (flutter/flutter#139129)
2023-11-28 [email protected] Fix textScalerOf and maybeTextScalerOf documentations (flutter/flutter#139123)
2023-11-28 [email protected] Roll Flutter Engine from c25cc65720de to 4f217e1f9afe (1 revision) (flutter/flutter#139126)
2023-11-28 [email protected] Roll Flutter Engine from 3381d3ff0df7 to c25cc65720de (1 revision) (flutter/flutter#139121)
2023-11-28 [email protected] Roll Flutter Engine from 96137d05fabc to 3381d3ff0df7 (4 revisions) (flutter/flutter#139119)
...
caseycrogers pushed a commit to caseycrogers/flutter that referenced this pull request Dec 29, 2023
…nment enum. (flutter#130264)

**What has been done?**
----------------------
Added new enumeration in `TableCellVerticalAlignment`, which sets the cell size to the same as the topmost cell. There are no noticeable problems in using it in all cells together, as there are in `TableCellVerticalAlignment.fill` which is made not to be used in all cells together because it has another purpose.

**Explanation of the logic**
----------------------
An assignment was made (which already existed in `TableCellVerticalAlignment.top; middle and bottom`) that assigns `rowHeight` the maximum double between the initialized height and the height of its child.

![image](https://github.com/flutter/flutter/assets/69699209/0fc9c168-5638-494b-aa0c-c579d0494c5e)

Basically, defining a minimum cell height based on its child, and letting each table row have its own height stipulated from the largest element, creating an `IntrinsicHeight` for TableCell automatically.

![image](https://github.com/flutter/flutter/assets/69699209/488b258a-3d25-4655-a9a0-381680468dec)

As the `TableCellVerticalAlignment` logic already provides for the use of the height of the largest cell in the row, it was possible to reuse this logic, and just not make the break statement that exists to fill in the calculation for `intrinsicHeight`.

Real example in an Android application after added enumeration
----------------------
![image](https://github.com/flutter/flutter/assets/69699209/51dce88d-f0f5-4644-942a-11ad218ffca0)

Opened issue
----------------------
FIX: flutter#130261
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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