Skip to content

[icon_tree_shaker] Tree-shake material and cupertino with 0 icons - #190905

Merged
dcharkes merged 2 commits into
flutter:masterfrom
dcharkes:omit-unused-icon-fonts
Aug 11, 2026
Merged

dcharkes merged 2 commits into
flutter:masterfrom
dcharkes:omit-unused-icon-fonts

Conversation

@dcharkes

Copy link
Copy Markdown
Contributor

Bug:

Ensures built-in fonts are tree-shaken if 0 icons are used.

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 11, 2026
@dcharkes dcharkes added the CICD Run CI/CD label Aug 11, 2026
@dcharkes
dcharkes marked this pull request as ready for review August 11, 2026 10:01

@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 updates the IconTreeShaker to subset unused known icon fonts (such as MaterialIcons and CupertinoIcons) to a single fallback code point when no icons are recorded, preventing them from being bundled in their entirety. It also adds corresponding tests to verify this behavior. The review feedback suggests optimizing the missingFonts calculation to avoid unnecessary set allocations and refactoring the fallback code point lookup to prevent a double lookup and eliminate a null assertion.

bkonyi
bkonyi previously approved these changes Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants