pub struct Row {
pub key: Option<KeyRef>,
pub main_axis_alignment: MainAxisAlignment,
pub main_axis_size: MainAxisSize,
pub cross_axis_alignment: CrossAxisAlignment,
pub text_direction: Option<TextDirection>,
pub vertical_direction: VerticalDirection,
pub text_baseline: Option<TextBaseline>,
pub spacing: f64,
pub children: Vec<WidgetRef>,
}Expand description
A widget that displays its children in a horizontal array.
To cause a child to expand to fill the available horizontal space, wrap the child in an
Expanded widget.
The Row widget does not scroll (and in general it is considered an error to have more
children in a Row than will fit in the available room). If you have a line of widgets and
want them to be able to scroll if there is insufficient room, consider using a ListView.
For a vertical variant, see Column.
If you only have one child, then consider using Align or Center to position the
child.
See also:
Flexible, to indicate children that should share the remaining room.Expanded, to indicate children that should take all the remaining room.Spacer, a widget that takes up space proportional to its flex value.- The catalog of layout widgets.
Dart’s class Row extends Flex: a distinct widget type whose behaviour is Flex’s with
the direction fixed at Axis::Horizontal.
Fields§
§key: Option<KeyRef>§main_axis_alignment: MainAxisAlignment§main_axis_size: MainAxisSizeSee Flex::main_axis_size.
cross_axis_alignment: CrossAxisAlignment§text_direction: Option<TextDirection>See Flex::text_direction.
vertical_direction: VerticalDirection§text_baseline: Option<TextBaseline>See Flex::text_baseline.
spacing: f64See Flex::spacing.
children: Vec<WidgetRef>Implementations§
Source§impl Row
impl Row
Sourcepub fn new() -> Row
pub fn new() -> Row
Creates a horizontal array of children; Dart’s named arguments are the setters.
Sourcepub fn main_axis_alignment(self, main_axis_alignment: MainAxisAlignment) -> Row
pub fn main_axis_alignment(self, main_axis_alignment: MainAxisAlignment) -> Row
Dart Row(mainAxisAlignment:).
Sourcepub fn main_axis_size(self, main_axis_size: MainAxisSize) -> Row
pub fn main_axis_size(self, main_axis_size: MainAxisSize) -> Row
Dart Row(mainAxisSize:).
Sourcepub fn cross_axis_alignment(
self,
cross_axis_alignment: CrossAxisAlignment,
) -> Row
pub fn cross_axis_alignment( self, cross_axis_alignment: CrossAxisAlignment, ) -> Row
Dart Row(crossAxisAlignment:).
Sourcepub fn text_direction(self, text_direction: TextDirection) -> Row
pub fn text_direction(self, text_direction: TextDirection) -> Row
Dart Row(textDirection:).
Sourcepub fn vertical_direction(self, vertical_direction: VerticalDirection) -> Row
pub fn vertical_direction(self, vertical_direction: VerticalDirection) -> Row
Dart Row(verticalDirection:).
Sourcepub fn text_baseline(self, text_baseline: TextBaseline) -> Row
pub fn text_baseline(self, text_baseline: TextBaseline) -> Row
Dart Row(textBaseline:).
Sourcepub fn children(self, children: impl IntoIterator<Item = WidgetRef>) -> Row
pub fn children(self, children: impl IntoIterator<Item = WidgetRef>) -> Row
Dart Row(children:).
Sourcepub fn direction(&self) -> Axis
pub fn direction(&self) -> Axis
The direction to use as the main axis: always Axis::Horizontal (the inherited
Flex::direction).
Sourcepub fn get_effective_text_direction(
&self,
app: &mut App,
context: BuildContext,
) -> Option<TextDirection>
pub fn get_effective_text_direction( &self, app: &mut App, context: BuildContext, ) -> Option<TextDirection>
Trait Implementations§
Source§impl MultiChildRenderObjectWidget for Row
impl MultiChildRenderObjectWidget for Row
Source§impl RenderObjectWidget for Row
impl RenderObjectWidget for Row
Source§type RenderObject = RenderFlex
type RenderObject = RenderFlex
covariant RenderObject parameter type.Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn create_render_object(
&self,
app: &mut App,
context: BuildContext,
) -> AnyRenderObject
fn create_render_object( &self, app: &mut App, context: BuildContext, ) -> AnyRenderObject
RenderObject class that this widget represents, using the
configuration described by this widget. Read moreSource§fn update_render_object(
&self,
app: &mut App,
context: BuildContext,
render_object: RenderHandle<RenderFlex>,
)
fn update_render_object( &self, app: &mut App, context: BuildContext, render_object: RenderHandle<RenderFlex>, )
create_render_object. Read moreSource§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
toStringShort, for a widget that names itself apart from its type, as
SizedBox.expand does; see Widget::to_string_short.Source§fn debug_visit_onstage_children(
&self,
app: &App,
children: &[AnyElement],
visitor: &mut dyn FnMut(AnyElement),
)
fn debug_visit_onstage_children( &self, app: &App, children: &[AnyElement], visitor: &mut dyn FnMut(AnyElement), )
debugVisitOnstageChildren of the element this widget makes, for a widget whose
Dart element subclass overrides it only to hide children (_OffstageElement,
_IndexedStackElement): calls visitor for each of children, in order, that is
onstage. Waft’s generic single- and multi-child elements stand in for those subclasses
and ask their widget here; an element of a widget’s own overrides
Element::debug_visit_onstage_children instead.Source§fn did_unmount_render_object(
&self,
app: &mut App,
render_object: RenderHandle<Self::RenderObject>,
)
fn did_unmount_render_object( &self, app: &mut App, render_object: RenderHandle<Self::RenderObject>, )
RenderObject will be of the same type as returned by this object’s
create_render_object.Auto Trait Implementations§
impl !RefUnwindSafe for Row
impl !Send for Row
impl !Sync for Row
impl !UnwindSafe for Row
impl Forget for Row
impl Freeze for Row
impl Move for Row
impl Unpin for Row
impl UnsafeUnpin for Rowwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Rc<dyn Widget>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<MultiChildRenderObjectKind> for Wwhere
W: MultiChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: ContainerRenderObjectMixin,
impl<W> IntoWidget<MultiChildRenderObjectKind> for Wwhere
W: MultiChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: ContainerRenderObjectMixin,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.