[material_ui] Port PR (#188729) from flutter/flutter to material_ui - #12645
[material_ui] Port PR (#188729) from flutter/flutter to material_ui#12645puneetkukreja98 wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
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.
| final DataTableSortIconBuilder? effectiveSortIconBuilder = | ||
| sortIconBuilder ?? | ||
| dataTableTheme.sortIconBuilder ?? | ||
| themeData.dataTableTheme.sortIconBuilder; |
There was a problem hiding this comment.
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;
This PR ports flutter/flutter#188729 from flutter/flutter to flutter/packages
Pre-Review Checklist
[shared_preferences]///).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-assistbot 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
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