FlexDirection enum

Defines the direction in which children are laid out in a flex container.

The flex direction determines the primary axis along which flex items are placed. It affects how items flow and wrap within the container. The direction can be horizontal (row-based) or vertical (column-based), and can be reversed to change the order of item placement.

Use this enum to control the main layout axis of a flex container. For example, setting direction to FlexDirection.row will arrange children horizontally, while FlexDirection.column arranges them vertically. Reverse directions (rowReverse, columnReverse) place items in the opposite order along the axis.

Inheritance
Available extensions

Values

row → const FlexDirection

Children are laid out horizontally from left to right. This is the default direction for most Western languages.

const FlexDirection(LayoutAxis.horizontal, false)
rowReverse → const FlexDirection

Children are laid out horizontally from right to left. Useful for right-to-left languages or when you want items in reverse order.

const FlexDirection(LayoutAxis.horizontal, true)
column → const FlexDirection

Children are laid out vertically from top to bottom. Commonly used for navigation menus or stacked content.

const FlexDirection(LayoutAxis.vertical, false)
columnReverse → const FlexDirection

Children are laid out vertically from bottom to top. Items are placed starting from the bottom of the container upwards.

const FlexDirection(LayoutAxis.vertical, true)

Properties

axis LayoutAxis
The layout axis (horizontal or vertical) associated with this direction.
final
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
reverse bool
Whether the direction is reversed (true) or normal (false).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<FlexDirection>
A constant List of the values in this enum, in order of their declaration.