LayoutExtensions extension

Commonly used extensions on Widgets.

on

Methods

aligned({Key? key, AlignmentGeometry alignment = Alignment.center, double? widthFactor, double? heightFactor}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that aligns its child within itself and optionally sizes itself based on the child's size.
aspectRatio({required double aspectRatio, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that attempts to size the child to a specific aspect ratio.
baseline({required TextBaseline baseline, required double baselineOffset, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Creates a widget that positions its child according to the child's baseline.
centered({double? widthFactor, double? heightFactor, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Centers the widget. If a size factor is non-null then the corresponding dimension of this widget will be the product of the child's dimension and the size factor. For example if widthFactor is 2.0 then the width of this widget will always be twice the width of the widget is is called on.
constrained({Key? key, BoxConstraints? boxConstraints, double? minWidth, double? maxWidth, double? minHeight, double? maxHeight}) Widget

Available on Widget, provided by the LayoutExtensions extension

Imposes additional constraints on its child.
container({Key? key, AlignmentGeometry? alignment, EdgeInsetsGeometry? padding, Color? color, Decoration? decoration, Decoration? foregroundDecoration, double? width, double? height, BoxConstraints? constraints, EdgeInsetsGeometry? margin, Matrix4? transform, AlignmentGeometry? transformAlignment, Clip clipBehavior = Clip.none}) Widget

Available on Widget, provided by the LayoutExtensions extension

Combines commmon position, painting, and sizing widgets.
customSingleChildLayout({required SingleChildLayoutDelegate delegate, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that defers the layout of its single child to a delegate.
expanded({int flex = 1, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that expands a child of a Row, Column, or Flex.
fitted({BoxFit fit = BoxFit.contain, AlignmentGeometry alignment = Alignment.center, Clip clipBehavior = Clip.none, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Scales and positions its child within itself according to fit.
flexible({int flex = 1, FlexFit fit = FlexFit.loose, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Controls how the child of a Row, Column, or Flex flexes.
fractionallySized({required double widthFactor, required double heightFactor, AlignmentGeometry alignment = Alignment.center, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that sizes its child to a fraction of the total available space.
intrinsicHeight({Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that sizes its child to the child's intrinsic height.
intrinsicWidth({Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that sizes its child to the child's intrinsic width.
invisible() Widget

Available on Widget, provided by the LayoutExtensions extension

Makes the widget invisible and unclickable.
limited({required double maxWidth, required double maxHeight, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A box that limits its size only when it's unconstrained.
offstage({bool offstage = true, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that lays the child out as if it was in the tree, but without painting anything, without making the child available for hit testing, and without taking any room in the parent.
overflowing({Key? key, AlignmentGeometry alignment = Alignment.center, double? minWidth, double? maxWidth, double? minHeight, double? maxHeight}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that imposes different constraints on its child than it gets from its parent, possibly allowing the child to overflow the parent.
padded({double? all, double? horizontal, double? vertical, double? top, double? bottom, double? left, double? right, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Adds a Padding widget around the current widget. Priority of padding is as follows:
sized({double? width, double? height, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A box with a specified size.
sizedOverflowing({required double width, required double height, AlignmentGeometry alignment = Alignment.center, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that is a specific size but passes its original constraints through to its child, which will probably overflow.
transformed({required Matrix4 transform, Offset? origin, AlignmentGeometry alignment = Alignment.center, bool transformHitTests = true, FilterQuality filterQuality = FilterQuality.low, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

A widget that applies a transformation before painting its child.
transformedFlip({bool flipX = false, bool flipY = false, Offset? origin, bool transformHitTests = true, FilterQuality filterQuality = FilterQuality.low, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Flips the child along the horizontal and/or vertical axes.
transformedRotate({required double angle, Offset? origin, AlignmentGeometry alignment = Alignment.center, bool transformHitTests = true, FilterQuality filterQuality = FilterQuality.low, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Rotate around the center. Angle is in clockwise radians.
transformedScale({required double scale, Offset? origin, AlignmentGeometry alignment = Alignment.center, bool transformHitTests = true, FilterQuality filterQuality = FilterQuality.low, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Scales it's child along the 2D pane
transformedTranslate({required Offset offset, bool transformHitTests = true, FilterQuality filterQuality = FilterQuality.low, Key? key}) Widget

Available on Widget, provided by the LayoutExtensions extension

Translates the child's position. Offset is in logical pixels.