buttonPadding property
Padding on TextButton, ElevatedButton and OutlinedButton.
Rounded buttons may need a bit more horizontal padding to accommodate for the rounding.
If undefined then defaults to each buttons un-themed textScale based
padding static function ButtonStyleButton.scaledPadding
where
Elevated, Filled and Outline button use padding:
textScaleFactor <= 1
- horizontal(16)1 < textScaleFactor <= 2
- lerp(horizontal(16), horizontal(8))2 < textScaleFactor <= 3
- lerp(horizontal(8), horizontal(4))3 < textScaleFactor
- horizontal(4)
And TextButton uses padding:
textScaleFactor <= 1
- all(8)1 < textScaleFactor <= 2
- lerp(all(8), horizontal(8))2 < textScaleFactor <= 3
- lerp(horizontal(8), horizontal(4))3 < textScaleFactor
- horizontal(4)
This default is the same in both Material 2 and Material 3 theme mode.
Implementation
final EdgeInsetsGeometry? buttonPadding;