defaultDensityForPlatform static method
- TargetPlatform platform
Returns a VisualDensity that is adaptive based on the given platform
.
For desktop platforms, this returns compact, and for other platforms, it returns a default-constructed VisualDensity.
See also:
- adaptivePlatformDensity which returns a VisualDensity that is adaptive based on defaultTargetPlatform.
Implementation
static VisualDensity defaultDensityForPlatform(TargetPlatform platform) {
return switch (platform) {
TargetPlatform.android || TargetPlatform.iOS || TargetPlatform.fuchsia => standard,
TargetPlatform.linux || TargetPlatform.macOS || TargetPlatform.windows => compact,
};
}