pub struct Column {
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 vertical array.
To cause a child to expand to fill the available vertical space, wrap the child in an
Expanded widget.
The Column widget does not scroll (and in general it is considered an error to have more
children in a Column 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 horizontal variant, see Row.
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 Column extends Flex: a distinct widget type whose behaviour is Flex’s
with the direction fixed at Axis::Vertical.
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 Column
impl Column
Sourcepub fn new() -> Column
pub fn new() -> Column
Creates a vertical array of children; Dart’s named arguments are the setters.
Sourcepub fn main_axis_alignment(
self,
main_axis_alignment: MainAxisAlignment,
) -> Column
pub fn main_axis_alignment( self, main_axis_alignment: MainAxisAlignment, ) -> Column
Dart Column(mainAxisAlignment:).
Sourcepub fn main_axis_size(self, main_axis_size: MainAxisSize) -> Column
pub fn main_axis_size(self, main_axis_size: MainAxisSize) -> Column
Dart Column(mainAxisSize:).
Sourcepub fn cross_axis_alignment(
self,
cross_axis_alignment: CrossAxisAlignment,
) -> Column
pub fn cross_axis_alignment( self, cross_axis_alignment: CrossAxisAlignment, ) -> Column
Dart Column(crossAxisAlignment:).
Sourcepub fn text_direction(self, text_direction: TextDirection) -> Column
pub fn text_direction(self, text_direction: TextDirection) -> Column
Dart Column(textDirection:).
Sourcepub fn vertical_direction(self, vertical_direction: VerticalDirection) -> Column
pub fn vertical_direction(self, vertical_direction: VerticalDirection) -> Column
Dart Column(verticalDirection:).
Sourcepub fn text_baseline(self, text_baseline: TextBaseline) -> Column
pub fn text_baseline(self, text_baseline: TextBaseline) -> Column
Dart Column(textBaseline:).
Sourcepub fn children(self, children: impl IntoIterator<Item = WidgetRef>) -> Column
pub fn children(self, children: impl IntoIterator<Item = WidgetRef>) -> Column
Dart Column(children:).
Sourcepub fn direction(&self) -> Axis
pub fn direction(&self) -> Axis
The direction to use as the main axis: always Axis::Vertical (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 RenderObjectWidget for Column
impl RenderObjectWidget for Column
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 Column
impl !Send for Column
impl !Sync for Column
impl !UnwindSafe for Column
impl Forget for Column
impl Freeze for Column
impl Move for Column
impl Unpin for Column
impl UnsafeUnpin for Columnwhere
*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.