-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add an adaptive visual density static function, and add it to the sample app. #51921
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
Conversation
|
/cc @csells |
|
Gold has detected one or more untriaged digests on patchset 2. |
b477b76 to
347877a
Compare
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
| // This makes the visual density adapt to the platform that you run | ||
| // the app on. For desktop platforms, the controls will be smaller and | ||
| // closer together (more dense) than on mobile platforms. | ||
| visualDensity: VisualDensity.adaptivePlatformDensity, |
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.
why do we need this? isn't being adaptive the default?
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.
No, being adaptive isn't the default, because the Material Design team wanted the "mobile" density to be the default. Their reasoning was that some desktop systems have touch screens, and so those screens should have 48x48 touch targets, so as not to compromise accessibility.
We had anecdotal evidence, however, that developers would like the option to have it be adaptive, so this was the compromise that we came up with.
Description
Adds a
VisualDensity.adaptivePlatformDensitystatic function that returns different values for visual density based on thedefaultTargetPlatform. Returnscompactfor desktop platforms, and a default visual density for other platforms.Issues
Tests
Breaking Change