Skip to content

Add missing properties to ListTileTheme.merge#121975

Merged
auto-submit[bot] merged 3 commits intoflutter:masterfrom
jpnurmi:list-tile-theme-merge
Mar 6, 2023
Merged

Add missing properties to ListTileTheme.merge#121975
auto-submit[bot] merged 3 commits intoflutter:masterfrom
jpnurmi:list-tile-theme-merge

Conversation

@jpnurmi
Copy link
Member

@jpnurmi jpnurmi commented Mar 5, 2023

This PR adds missing mouseCursor and visualDensity arguments to ListTileTheme.merge, makes it query the respective values from the parent theme, and passes them to the newly created ListTileThemeData. This ensures that ListTileThemeData.mouseCursor and ListTileThemeData.visualDensity are not lost when using ListTileTheme.merge.

Fixes: #121974

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 flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Mar 5, 2023
@jpnurmi jpnurmi force-pushed the list-tile-theme-merge branch from c914b10 to 113284a Compare March 5, 2023 19:48
@TahaTesser TahaTesser self-requested a review March 6, 2023 08:47
@TahaTesser
Copy link
Contributor

TahaTesser commented Mar 6, 2023

Thanks for the PR! @jpnurmi

This looks good, however, we're just testing explicit values in the ListTileTheme.merge.

When trying something like this, parent values are null in your test.

        print('mouseCursor: $mouseCursor, parent.mouseCursor: ${parent.mouseCursor}');
        print('visualDensity: $visualDensity: parent.visualDensity: ${parent.visualDensity}');

It would be great if the test checks that all properties actually getting merged with parent ListTileTheme, this will ensure all properties are supported as you're testing them here.

Looks like we're also missing titleTextStyle, subtitleTextStyle, and leadingAndTrailingTextStyle. I added these properties and somehow missed the ListTileTheme.merge.

Copy link
Contributor

@TahaTesser TahaTesser left a comment

Choose a reason for hiding this comment

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

LGTM!

I need a second review from @HansMuller before merging this.

@TahaTesser TahaTesser changed the title ListTileTheme.merge(): add missing mouseCursor & visualDensity Add missing properties to ListTileTheme.merge Mar 6, 2023
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 6, 2023
@auto-submit auto-submit bot merged commit f873252 into flutter:master Mar 6, 2023
@jpnurmi jpnurmi deleted the list-tile-theme-merge branch March 6, 2023 18:50
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 8, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 8, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 8, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
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 f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add mouseCursor and visualDensity arguments to ListTileTheme.merge

3 participants