CenterWidgetExtension extension
Extension methods for Widget that provide convenient centering functionality.
This extension adds methods to easily center widgets using Center widgets with optional width and height factor controls. All methods return new Center widgets without modifying the original widget.
The extension provides both combined centering (center) and individual factor control (centerWidth, centerHeight) for flexible alignment control.
Example usage:
Text('Centered text')
.center()
.centerWidth(0.8); // Center with 80% width factor
- on
Methods
-
center(
{double? widthFactor, double? heightFactor}) → Center -
Available on Widget, provided by the CenterWidgetExtension extension
Centers the widget with optional width and height factors. -
centerHeight(
double? heightFactor) → Center -
Available on Widget, provided by the CenterWidgetExtension extension
Centers the widget with a specific height factor. -
centerWidth(
double? widthFactor) → Center -
Available on Widget, provided by the CenterWidgetExtension extension
Centers the widget with a specific width factor.