Skip to content

[material_ui] Port PR (#188729) from flutter/flutter to material_ui - #12645

Open
puneetkukreja98 wants to merge 6 commits into
flutter:mainfrom
puneetkukreja98:port-pr-188729
Open

[material_ui] Port PR (#188729) from flutter/flutter to material_ui#12645
puneetkukreja98 wants to merge 6 commits into
flutter:mainfrom
puneetkukreja98:port-pr-188729

Conversation

@puneetkukreja98

Copy link
Copy Markdown
Contributor

This PR ports flutter/flutter#188729 from flutter/flutter to flutter/packages

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a sortIconBuilder parameter to DataTable, PaginatedDataTable, and DataTableThemeData to support custom sorting indicators, along with corresponding tests and documentation. Feedback suggests simplifying the theme resolution in DataTable by removing the redundant fallback to themeData.dataTableTheme.sortIconBuilder, as DataTableTheme.of(context) already handles this fallback.

Comment on lines +928 to +931
final DataTableSortIconBuilder? effectiveSortIconBuilder =
sortIconBuilder ??
dataTableTheme.sortIconBuilder ??
themeData.dataTableTheme.sortIconBuilder;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The fallback to themeData.dataTableTheme.sortIconBuilder is redundant and inconsistent with Flutter's theme resolution pattern.

DataTableTheme.of(context) already returns Theme.of(context).dataTableTheme if there is no inherited DataTableTheme ancestor. In Flutter, if an inherited theme is present, it completely overrides the global theme rather than merging with it. Therefore, we should only resolve from sortIconBuilder and dataTableTheme.sortIconBuilder.

    final DataTableSortIconBuilder? effectiveSortIconBuilder =
        sortIconBuilder ?? dataTableTheme.sortIconBuilder;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh yeah. This is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants