Skip to content

Add support for fill, weight, grade, and optical size to Icon#106896

Merged
guidezpl merged 18 commits intoflutter:masterfrom
guidezpl:material-symbols-support
Jul 20, 2022
Merged

Add support for fill, weight, grade, and optical size to Icon#106896
guidezpl merged 18 commits intoflutter:masterfrom
guidezpl:material-symbols-support

Conversation

@guidezpl
Copy link
Member

@guidezpl guidezpl commented Jun 30, 2022

This PR adds framework support required for Material Symbols (design doc, #102560).

Add 4 members to Icon: fill, weight, grade, and opticalSize. Under the hood, pass these to the engine using the FontVariation API. No guarantees are provided:

  • If used with a font which does not support these axes => no effect
  • No bounds checking for values against the font ⇒ no effect outside variable font's supported range

Add 4 corresponding members to IconThemeData to customize all icons in a given widget subtree.

Also:

  • debugFillProperties is completed
  • properties are reordered for consistency
  • documentation is improved

Tests

  • Basic bounds checking
  • Instantiation
  • Fallbacks

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.

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

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

Labels

f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants