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.
To create a local project with this code sample, run:
flutter create --sample=widgets.OverflowBar.1 mysample



OverflowBar({Key key, double spacing: 0.0, 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. [...]


children List<Widget>
The widgets below this widget in the tree. [...]
final, inherited
clipBehavior Clip
The content will be clipped (or not) according to this option. [...]
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
overflowAlignment OverflowBarAlignment
The horizontal alignment of the children within the vertical "overflow" layout. [...]
overflowDirection VerticalDirection
Defines the order that the children appear in, if the horizontal layout overflows. [...]
overflowSpacing double
The height of the gap between children in the vertical "overflow" layout. [...]
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
spacing double
The width of the gap between children for the default horizontal layout. [...]
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. [...]


createElement() MultiChildRenderObjectElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
createRenderObject(BuildContext context) → _RenderOverflowBar
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget. [...]
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
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.
@protected, inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toDiagnosticsNode({String name, DiagnosticsTreeStyle style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. [...]
toString({DiagnosticLevel minLevel: DiagnosticLevel.info}) String
Returns a string representation of this object.
toStringDeep({String prefixLineOne: '', String prefixOtherLines, DiagnosticLevel minLevel: DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants. [...]
toStringShallow({String joiner: ', ', DiagnosticLevel minLevel: DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object. [...]
toStringShort() String
A short, textual description of this widget.
updateRenderObject(BuildContext context, covariant _RenderOverflowBar 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. [...]


operator ==(Object other) bool
The equality operator. [...]
@nonVirtual, inherited