Layout class final

A node's layout.

Annotations
  • @immutable

Constructors

Layout({AxisSize width = const AxisSize.fixed(0), AxisSize height = const AxisSize.fixed(0), int flex = 1, bool squeezable = false, BoxConstraints constraints = BoxConstraints.none, EdgeInsets margin = EdgeInsets.zero, EdgeInsets padding = EdgeInsets.zero, AxisPosition x = AxisPosition.zero, AxisPosition y = AxisPosition.zero, Alignment? align, double? aspectRatio, double? widthFactor, double? heightFactor, int order = 0, double? basis, int columnSpan = 1, int rowSpan = 1, int? columnStart, int? rowStart})
const

Properties

align → Alignment?
Alignment in its slot under a row/column parent (Align).
final
aspectRatio → double?
Width / height the node keeps when its parent resizes it.
final
basis → double?
CSS flex-basis: under a wrapping row, column or flex, the main size the child takes when lines are broken; a child that fills the main axis then grows by its flex share of what its line leaves.
final
columnSpan → int
Under a grid: how many columns and rows the item covers (CSS grid-column: span n, grid-row: span n); at most the grid's columns.
final
columnStart → int?
Under a grid: the column and row the item starts in, 1 the first (CSS grid-column-start, grid-row-start); null: the next free cell.
final
constraints → BoxConstraints
final
flex → int
Share of a row/column's free space (fill and flexible children).
final
hashCode → int
The hash code for this object.
no setteroverride
height → AxisSize
final
heightFactor → double?
A share (0–1 and up) of the room its parent gives it on that axis (FractionallySizedBox): a progress bar's fill is widthFactor: 0.6 of its track. Null: sized by width / height. Bindable (layout.widthFactor).
final
margin → EdgeInsets
Space around the node, outside its box.
final
order → int
CSS order: under a row, column or flex, children are laid out (and painted) by ascending order, those with the same order as listed.
final
padding → EdgeInsets
Space between the node's box and its content (Flutter's Padding). A text's padding sits around its lines, as Padding(child: Text(...)): a hugging text grows by it.
final
rowSpan → int
Under a grid: how many columns and rows the item covers (CSS grid-column: span n, grid-row: span n); at most the grid's columns.
final
rowStart → int?
Under a grid: the column and row the item starts in, 1 the first (CSS grid-column-start, grid-row-start); null: the next free cell.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
squeezable → bool
A hugging child of a row/column that may shrink below its content size when the row/column runs out of space (Flexible, loose).
final
width → AxisSize
final
widthFactor → double?
A share (0–1 and up) of the room its parent gives it on that axis (FractionallySizedBox): a progress bar's fill is widthFactor: 0.6 of its track. Null: sized by width / height. Bindable (layout.widthFactor).
final
x → AxisPosition
Position under a freeform parent.
final
y → AxisPosition
Position under a freeform parent.
final

Methods

along(bool horizontal) → AxisSize
copyWith({AxisSize? width, AxisSize? height, int? flex, bool? squeezable, BoxConstraints? constraints, EdgeInsets? margin, EdgeInsets? padding, AxisPosition? x, AxisPosition? y, Alignment? align()?, double? aspectRatio()?, double? widthFactor()?, double? heightFactor()?, int? order, double? basis()?, int? columnSpan, int? rowSpan, int? columnStart()?, int? rowStart()?}) → Layout
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Object? json, {bool hugs = false, bool fillsWidth = false}) → Layout
hugs: an axis the JSON does not give hugs (a control's, WidgetSpec.hugs) instead of being fixed at 0.