SideBySide class
The SideBySide widget disposes 2 widgets horizontally, while achieving a layout which is impossible for both the native Row and the RowSuper widgets.
-
The startChild will be on the left, and will occupy as much space as it wants, up to the available horizontal space.
-
The endChild will be on the right of the startChild , and it will occupy the endChild of the available space. Note: This means, if the
start
widget occupies all the available space, then endChild widget will not be displayed (since it will be sized as0
width).
For example, suppose you want to create a title, with a divider that occupies the endChild of the space. You want the distance between the startChild and the divider widgets to be at least 8 pixels, and you want the divider to occupy at least 15 pixels of horizontal space:
return SideBySide(
startChild: Text("First Chapter", textWidthBasis: TextWidthBasis.longestLine),
endChild: Divider(color: Colors.grey),
innerDistance: 8,
minEndChildWidth: 20,
);
You can add an innerDistance, in pixels, between the startChild and endChild s. It can be negative, in which case the widgets will overlap.
The crossAxisAlignment parameter specifies how to align the startChild and endChild
widgets vertically. The default is to center them. At the moment, only
CrossAxisAlignment.start
, CrossAxisAlignment.end
and CrossAxisAlignment.center
work.
For more info, see: https://pub.dartlang.org/packages/assorted_layout_widgets
- Inheritance
Constructors
- SideBySide({Key? key, required Widget startChild, required Widget endChild, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, double innerDistance = 0, double minEndChildWidth = 0})
Properties
-
children
→ List<
Widget> -
The widgets below this widget in the tree.
finalinherited
- crossAxisAlignment → CrossAxisAlignment
-
The crossAxisAlignment parameter specifies how to align the startChild and endChild
vertically. The default is to center them. At the moment, only CrossAxisAlignment.start,
CrossAxisAlignment.end and CrossAxisAlignment.center work.
final
- endChild → Widget
-
The endChild will be on the right of the startChild , and it will occupy the endChild of
the available space. Note: This means, if the
start
widget occupies all the available space, then endChild widget will not be displayed (since it will be sized as0
width).final - hashCode → int
-
The hash code for this object.
no setterinherited
- innerDistance → double
-
The distance in pixels between the startChild and endChild s.
The default is zero. It can be negative, in which case the widgets will overlap.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- minEndChildWidth → double
-
The minimum width, in pixels, that the endChild should occupy.
The default is zero.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startChild → Widget
-
The startChild will be on the left, and will occupy as much space as it wants,
up to the available horizontal space.
final
Methods
-
createElement(
) → MultiChildRenderObjectElement -
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
-
createRenderObject(
BuildContext context) → _RenderSideBySide -
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.
inherited
-
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 _RenderSideBySide 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