RenderFlex constructor

RenderFlex({List<RenderBox> children, Axis direction: Axis.horizontal, MainAxisSize mainAxisSize: MainAxisSize.max, MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center, TextDirection textDirection, VerticalDirection verticalDirection: VerticalDirection.down, TextBaseline textBaseline })

Creates a flex render object.

By default, the flex layout is horizontal and children are aligned to the start of the main axis and the center of the cross axis.

Implementation

RenderFlex({
  List<RenderBox> children,
  Axis direction = Axis.horizontal,
  MainAxisSize mainAxisSize = MainAxisSize.max,
  MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
  CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  TextDirection textDirection,
  VerticalDirection verticalDirection = VerticalDirection.down,
  TextBaseline textBaseline,
}) : assert(direction != null),
     assert(mainAxisAlignment != null),
     assert(mainAxisSize != null),
     assert(crossAxisAlignment != null),
     _direction = direction,
     _mainAxisAlignment = mainAxisAlignment,
     _mainAxisSize = mainAxisSize,
     _crossAxisAlignment = crossAxisAlignment,
     _textDirection = textDirection,
     _verticalDirection = verticalDirection,
     _textBaseline = textBaseline {
  addAll(children);
}