pub enum MainAxisSize {
Min,
Max,
}Expand description
How much space should be occupied in the main axis.
During a flex layout, available space along the main axis is allocated to children. After allocating space, there might be some remaining free space. This value controls whether to maximize or minimize the amount of free space, subject to the incoming layout constraints.
See also:
RenderFlex, the flex render object.MainAxisAlignment, which controls how the free space is distributed.
Variants§
Min
Minimize the amount of free space along the main axis, subject to the incoming layout constraints.
If the incoming layout constraints have a large enough BoxConstraints::min_width or
BoxConstraints::min_height, there might still be a non-zero amount of free space.
If the incoming layout constraints are unbounded, and any children have a non-zero
FlexParentData::flex and a FlexFit::Tight fit, the RenderFlex will assert,
because there would be infinite remaining free space and boxes cannot be given infinite
size.
Max
Maximize the amount of free space along the main axis, subject to the incoming layout constraints.
If the incoming layout constraints have a small enough BoxConstraints::max_width or
BoxConstraints::max_height, there might still be no free space.
If the incoming layout constraints are unbounded, the RenderFlex will assert, because
there would be infinite remaining free space and boxes cannot be given infinite size.
Trait Implementations§
Source§impl Clone for MainAxisSize
impl Clone for MainAxisSize
impl Copy for MainAxisSize
Source§impl Debug for MainAxisSize
impl Debug for MainAxisSize
impl Eq for MainAxisSize
Source§impl PartialEq for MainAxisSize
impl PartialEq for MainAxisSize
impl StructuralPartialEq for MainAxisSize
Auto Trait Implementations§
impl Freeze for MainAxisSize
impl RefUnwindSafe for MainAxisSize
impl Send for MainAxisSize
impl Sync for MainAxisSize
impl Unpin for MainAxisSize
impl UnsafeUnpin for MainAxisSize
impl UnwindSafe for MainAxisSize
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.