Add an adaptive visual density static function, and add it to the sample app.#51921
Merged
gspencergoog merged 2 commits intoflutter:masterfrom Mar 31, 2020
Merged
Add an adaptive visual density static function, and add it to the sample app.#51921gspencergoog merged 2 commits intoflutter:masterfrom
gspencergoog merged 2 commits intoflutter:masterfrom
Conversation
Contributor
Author
|
/cc @csells |
|
Gold has detected one or more untriaged digests on patchset 2. |
b477b76 to
347877a
Compare
Hixie
reviewed
May 1, 2020
| // 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, |
Contributor
There was a problem hiding this comment.
why do we need this? isn't being adaptive the default?
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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