Flex class
A widget that displays its children in a horizontal or vertical line.
Use Row for horizontal or Column for vertical instead of using Flex directly. Controls alignment via MainAxisAlignment and CrossAxisAlignment.
- Inheritance
- Implementers
Constructors
-
Flex({Key? key, required List<
Widget> children, required Axis direction, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, MainAxisSize mainAxisSize = MainAxisSize.max}) -
Creates a Flex layout widget.
const
Properties
-
children
→ List<
Widget> -
The list of child widgets.
finalinherited
- crossAxisAlignment → CrossAxisAlignment
-
How children are aligned on the cross axis.
final
- direction → Axis
-
The direction along which children are laid out.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another in the tree.
finalinherited
- mainAxisAlignment → MainAxisAlignment
-
How children are distributed along the main axis.
final
- mainAxisSize → MainAxisSize
-
How much space the flex should occupy on the main axis.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → MultiChildRenderObjectElement -
Creates the Element for this widget.
inherited
-
createRenderObject(
BuildContext context) → RenderFlex -
Creates the RenderObject for this widget.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateRenderObject(
BuildContext context, RenderObject renderObject) → void -
Updates the
renderObjectto reflect the current widget configuration.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited