diff --git a/packages/flutter/lib/src/material/filled_button.dart b/packages/flutter/lib/src/material/filled_button.dart index 2b8ac13c8c4..9dae6901373 100644 --- a/packages/flutter/lib/src/material/filled_button.dart +++ b/packages/flutter/lib/src/material/filled_button.dart @@ -61,6 +61,14 @@ enum _FilledButtonVariant { filled, tonal } /// ** See code in examples/api/lib/material/filled_button/filled_button.0.dart ** /// {@end-tool} /// +/// ## Visual density effects +/// +/// The button's appearance is affected by the [VisualDensity] from the enclosing +/// [Theme] or from its [style]. Visual density adjusts the [ButtonStyle.padding] +/// and [ButtonStyle.minimumSize] to accommodate different UI densities across platforms. +/// See [VisualDensity] for more details on how it affects component layout and +/// the platform-specific defaults. +/// /// See also: /// /// * [ElevatedButton], a filled button whose material elevates when pressed. diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index d9499d35a9a..6b6b3ef3430 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -3153,6 +3153,10 @@ class _FifoCache { /// the Material Design specification. It does not affect text sizes, icon /// sizes, or padding values. /// +/// The default visual density varies by platform: mobile platforms (Android, iOS, +/// Fuchsia) use [VisualDensity.standard], while desktop platforms (macOS, Windows, +/// Linux) use [VisualDensity.compact]. See [defaultDensityForPlatform] for more details. +/// /// For example, for buttons, it affects the spacing around the child of the /// button. For lists, it affects the distance between baselines of entries in /// the list. For chips, it only affects the vertical size, not the horizontal @@ -3163,6 +3167,7 @@ class _FifoCache { /// * [Checkbox] /// * [Chip] /// * [ElevatedButton] +/// * [FilledButton] /// * [IconButton] /// * [InputDecorator] (which gives density support to [TextField], etc.) /// * [ListTile] @@ -3240,8 +3245,8 @@ class VisualDensity with Diagnosticable { /// 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]. + /// For mobile platforms (Android, iOS, Fuchsia), this returns [VisualDensity.standard], + /// and for desktop platforms (macOS, Windows, Linux), it returns [VisualDensity.compact]. /// /// See also: ///