PaddingExtensions extension
Extension methods for Widget that provide convenient padding functionality.
This extension adds methods to easily apply padding to any widget using various padding configurations. All methods return new Padding widgets without modifying the original widget.
The extension provides both granular control (paddingOnly) and convenient shortcuts (paddingAll, paddingHorizontal, etc.) for common padding patterns.
Example usage:
Text('Hello World')
.paddingAll(16.0)
.paddingHorizontal(8.0); // Adds 16px all around, then 8px more horizontally
- on
Methods
-
padding(
EdgeInsets padding) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies the specified EdgeInsets padding to the widget. -
paddingAll(
double padding) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies uniform padding to all sides of the widget. -
paddingBottom(
double bottom) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies padding to the bottom side only. -
paddingHorizontal(
double horizontal) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies padding to the left and right sides only. -
paddingLeft(
double left) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies padding to the left side only. -
paddingOnly(
{double left = 0, double top = 0, double right = 0, double bottom = 0}) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies specific padding to individual sides of the widget. -
paddingRight(
double right) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies padding to the right side only. -
paddingSymmetric(
{double horizontal = 0, double vertical = 0}) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies symmetric padding to horizontal and vertical axes. -
paddingTop(
double top) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies padding to the top side only. -
paddingVertical(
double vertical) → Padding -
Available on Widget, provided by the PaddingExtensions extension
Applies padding to the top and bottom sides only.