OverflowBar class

A widget that lays out its children in a row unless they "overflow" the available horizontal space, in which case it lays them out in a column instead.

This widget's width will expand to contain its children and the specified spacing until it overflows. The overflow column will consume all of the available width. The overflowAlignment defines how each child will be aligned within the overflow column and the overflowSpacing defines the gap between each child.

The order that the children appear in the horizontal layout is defined by the textDirection, just like the Row widget. If the layout overflows, then children's order within their column is specified by overflowDirection instead.

This example defines a simple approximation of a dialog layout, where the layout of the dialog's action buttons are defined by an OverflowBar. The content is wrapped in a SingleChildScrollView, so that if overflow occurs, the action buttons will still be accessible by scrolling, no matter how much vertical space is available.
link

To create a local project with this code sample, run:
flutter create --sample=widgets.OverflowBar.1 mysample

Inheritance

Constructors

OverflowBar({Key? key, double spacing = 0.0, MainAxisAlignment? alignment, double overflowSpacing = 0.0, OverflowBarAlignment overflowAlignment = OverflowBarAlignment.start, VerticalDirection overflowDirection = VerticalDirection.down, TextDirection? textDirection, Clip clipBehavior = Clip.none, List<Widget> children = const <Widget>[]})
Constructs an OverflowBar.
const

Properties

alignment MainAxisAlignment?
Defines the children's horizontal layout according to the same rules as for Row.mainAxisAlignment.
final
children List<Widget>
The widgets below this widget in the tree.
finalinherited
clipBehavior Clip
The content will be clipped (or not) according to this option.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
overflowAlignment OverflowBarAlignment
The horizontal alignment of the children within the vertical "overflow" layout.
final
overflowDirection VerticalDirection
Defines the order that the children appear in, if the horizontal layout overflows.
final
overflowSpacing double
The height of the gap between children in the vertical "overflow" layout.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spacing double
The width of the gap between children for the default horizontal layout.
final
textDirection TextDirection?
Determines the order that the children appear in for the default horizontal layout, and the interpretation of OverflowBarAlignment.start and OverflowBarAlignment.end for the vertical overflow layout.
final

Methods

createElement() MultiChildRenderObjectElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
createRenderObject(BuildContext context) RenderObject
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
didUnmountRenderObject(covariant RenderObject renderObject) → void
A render object previously associated with this widget has been removed from the tree. The given RenderObject will be of the same type as returned by this object's createRenderObject.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited
updateRenderObject(BuildContext context, covariant RenderObject renderObject) → void
Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.
override

Operators

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