Skip to content

Commit 13ed551

Browse files
authored
Update InputDecoration.contentPadding documentation (#143519)
## Description This PR updates the `InputDecoration.contentPadding` documentation to detail both Material 3 and Material 2 default values. ## Related Issue Follow-up to flutter/flutter#142981. ## Tests Documentation only.
1 parent ae1488c commit 13ed551

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/flutter/lib/src/material/input_decorator.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,9 +2971,26 @@ class InputDecoration {
29712971
///
29722972
/// If [isCollapsed] is true then [contentPadding] is [EdgeInsets.zero].
29732973
///
2974+
/// ### Material 3 default content padding
2975+
///
2976+
/// If `isOutline` property of [border] is false and if [filled] is true then
2977+
/// [contentPadding] is `EdgeInsets.fromLTRB(12, 4, 12, 4)` when [isDense]
2978+
/// is true and `EdgeInsets.fromLTRB(12, 8, 12, 8)` when [isDense] is false.
2979+
///
2980+
/// If `isOutline` property of [border] is false and if [filled] is false then
2981+
/// [contentPadding] is `EdgeInsets.fromLTRB(0, 4, 0, 4)` when [isDense] is
2982+
/// true and `EdgeInsets.fromLTRB(0, 8, 0, 8)` when [isDense] is false.
2983+
///
2984+
/// If `isOutline` property of [border] is true then [contentPadding] is
2985+
/// `EdgeInsets.fromLTRB(12, 16, 12, 8)` when [isDense] is true
2986+
/// and `EdgeInsets.fromLTRB(12, 20, 12, 12)` when [isDense] is false.
2987+
///
2988+
/// ### Material 2 default content padding
2989+
///
29742990
/// If `isOutline` property of [border] is false and if [filled] is true then
29752991
/// [contentPadding] is `EdgeInsets.fromLTRB(12, 8, 12, 8)` when [isDense]
29762992
/// is true and `EdgeInsets.fromLTRB(12, 12, 12, 12)` when [isDense] is false.
2993+
///
29772994
/// If `isOutline` property of [border] is false and if [filled] is false then
29782995
/// [contentPadding] is `EdgeInsets.fromLTRB(0, 8, 0, 8)` when [isDense] is
29792996
/// true and `EdgeInsets.fromLTRB(0, 12, 0, 12)` when [isDense] is false.

0 commit comments

Comments
 (0)