-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Set IconButton.visualDensity default to VisualDensity.standard
#109349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set IconButton.visualDensity default to VisualDensity.standard
#109349
Conversation
HansMuller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| /// a component theme parameter like [sliderTheme], [toggleButtonsTheme], | ||
| /// or [bottomNavigationBarTheme]. | ||
| /// | ||
| /// In Material Design 3, the [IconButton.visualDensity] isn't affected by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment probably belongs with the visualDensity API doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved. Thanks!
…ity.standard` (flutter#109349)" (flutter#109421)" This reverts commit 625d96a.
#109432) * Revert "Revert "Set `IconButton.visualDensity` default to `VisualDensity.standard` (#109349)" (#109421)" Co-authored-by: Qun Cheng <[email protected]>
This PR fixes #64702, so the


IconButtons on AppBar have a proper circular splash.This PR also sets the default
visualDensityof IconButton toVisualDensity.standard, to ensure the default IconButton will have a circular shape even if the app is running on desktop/web platforms (whose default compact visual density changes the shape to be rounded rectangle).Just for more information, the default

IconButtonhas a size of 48x48, 4 pixels of padding, and a circular shape. However, if a button changes to a different size or shape, the padding between buttons might be different from the default. The below code can achieve a combination of circular IconButton and rounded rectangle IconButton with the same paddings between each other, like the screenshot below.Details
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.