ContainerWidgetExtension extension

Extension methods for Widget that provide convenient container functionality.

This extension adds a method to easily wrap widgets in Container widgets with comprehensive styling and layout options. The method returns a new Container widget without modifying the original widget.

The container method provides access to all major Container properties including dimensions, colors, padding, margins, decorations, constraints, alignment, and clipping behavior.

Example usage:

Text('Styled content')
  .container(
    width: 200,
    height: 100,
    color: Colors.blue,
    padding: EdgeInsets.all(16),
    alignment: Alignment.center,
  );
on

Methods

container({double? width, double? height, Color? color, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, BoxDecoration? decoration, BoxConstraints? constraints, AlignmentGeometry? alignment, Clip clipBehavior = Clip.none}) Container

Available on Widget, provided by the ContainerWidgetExtension extension

Wraps the widget in a Container with comprehensive styling options.