Skip to content

Conversation

@jason-simmons
Copy link
Member

This adds documentation of the change made by flutter/flutter#175771

@jason-simmons jason-simmons requested review from a team and sfshaza2 as code owners October 30, 2025 20:08
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jason-simmons, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces new documentation for a breaking change in Flutter that enhances how FontWeight interacts with variable fonts. The update streamlines font weight management by allowing FontWeight to directly control the weight attribute of variable fonts, expands the range of possible FontWeight values, and deprecates an older property, ultimately simplifying font styling for developers.

Highlights

  • FontWeight for Variable Fonts: FontWeight in text styles now automatically sets the weight attribute of variable fonts, eliminating the need for separate FontVariation usage for weight control.
  • Expanded FontWeight Range: FontWeight instances can now be created with arbitrary integer values from 1 to 1000, enabling more precise weight adjustments beyond the standard w100-w900 range.
  • FontWeight.index Deprecation: The FontWeight.index property has been deprecated, and FontWeight.value should be used instead for obtaining the font's thickness level.
  • Potential Rendering Changes: Applications using variable fonts without explicitly setting FontVariation('wght') might observe changes in text rendering due to the new default behavior.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 new breaking change documentation page for FontWeight handling of variable fonts. The new page is well-written and clear. I've made a few suggestions to improve consistency and to make the migration guide more explicit for developers. Additionally, the index.md file has been updated, but the new entries are not in alphabetical order as stated in the document. I've added comments to point this out.

ranging from 1 to 1000. This allows usage of weights beyond the
`FontWeight.w100` through `FontWeight.w900` range with values that are not
multiples of 100. This also means that linear interpolation of fonts using
`FontWeight.lerp` can yield values other than `FontWeight.w100` through `w900`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't feel the need to add the class name here or in the next suggested change.

* [`$FLUTTER_ROOT/version` replaced by `$FLUTTER_ROOT/bin/cache/flutter.version.json`][]
* [SnackBar with action no longer auto-dismisses][]
* [Deprecate `SemanticsProperties.focusable` and `SemanticsConfiguration.isFocusable`][]
* [`FontWeight` also controls the weight attribute of variable fonts][]
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The documentation on line 35 states that this list is in alphabetical order. This new entry has been appended to the end of the list, but it should be placed alphabetically. Please insert it in the correct location to maintain the sort order.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have strong feelings about this one, either.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorted this list

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Oct 30, 2025

Visit the preview URL for this PR (updated for commit 5e3b957):

https://flutter-docs-prod--pr12615-font-weight-breaking-kzvrybnk.web.app

I'm ok with this change.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
ranging from 1 to 1000. This allows usage of weights beyond the
`FontWeight.w100` through `FontWeight.w900` range with values that are not
multiples of 100. This also means that linear interpolation of fonts using
`FontWeight.lerp` can yield values other than `FontWeight.w100` through `w900`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't feel the need to add the class name here or in the next suggested change.

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

lgtm. Most of the suggested changes aren't a bit deal to me, but the one "For example," addition does improve clarity.

@flutter flutter deleted a comment from gemini-code-assist bot Oct 30, 2025
@flutter flutter deleted a comment from gemini-code-assist bot Oct 30, 2025
@sfshaza2 sfshaza2 merged commit 2ba9d02 into flutter:main Oct 30, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants