pub struct RenderFlex { /* private fields */ }Expand description
Displays its children in a one-dimensional array.
§Layout algorithm
This section describes how the framework causes RenderFlex to position its children.
See BoxConstraints for an introduction to box layout models.
Layout for a RenderFlex proceeds in six steps:
- Layout each child with a null or zero flex factor with unbounded main axis constraints and
the incoming cross axis constraints. If the
cross_axis_alignmentisCrossAxisAlignment::Stretch, instead use tight cross axis constraints that match the incoming max extent in the cross axis. - Divide the remaining main axis space among the children with non-zero flex factors according to their flex factor. For example, a child with a flex factor of 2.0 will receive twice the amount of main axis space as a child with a flex factor of 1.0.
- Layout each of the remaining children with the same cross axis constraints as in step 1,
but instead of using unbounded main axis constraints, use max axis constraints based on the
amount of space allocated in step 2. Children with
FlexFit::Tightare given tight constraints (i.e., forced to fill the allocated space), and children withFlexFit::Looseare given loose constraints (i.e., not forced to fill the allocated space). - The cross axis extent of the
RenderFlexis the maximum cross axis extent of the children (which will always satisfy the incoming constraints). - The main axis extent of the
RenderFlexis determined by themain_axis_sizeproperty. If it isMainAxisSize::Max, then the main axis extent of theRenderFlexis the max extent of the incoming main axis constraints. If it isMainAxisSize::Min, then the main axis extent is the sum of the main axis extents of the children (subject to the incoming constraints). - Determine the position for each child according to the
main_axis_alignmentand thecross_axis_alignment. For example, if themain_axis_alignmentisMainAxisAlignment::SpaceBetween, any main axis space that has not been allocated to children is divided evenly and placed between the children.
Implementations§
Source§impl RenderFlex
impl RenderFlex
Sourcepub fn new(app: &mut App) -> RenderHandle<RenderFlex>
pub fn new(app: &mut App) -> RenderHandle<RenderFlex>
Sourcepub fn direction(self: RenderHandle<Self>, app: &App) -> Axis
pub fn direction(self: RenderHandle<Self>, app: &App) -> Axis
Sourcepub fn set_direction(self: RenderHandle<Self>, app: &mut App, value: Axis)
pub fn set_direction(self: RenderHandle<Self>, app: &mut App, value: Axis)
Sourcepub fn main_axis_alignment(
self: RenderHandle<Self>,
app: &App,
) -> MainAxisAlignment
pub fn main_axis_alignment( self: RenderHandle<Self>, app: &App, ) -> MainAxisAlignment
Sourcepub fn set_main_axis_alignment(
self: RenderHandle<Self>,
app: &mut App,
value: MainAxisAlignment,
)
pub fn set_main_axis_alignment( self: RenderHandle<Self>, app: &mut App, value: MainAxisAlignment, )
Sourcepub fn main_axis_size(self: RenderHandle<Self>, app: &App) -> MainAxisSize
pub fn main_axis_size(self: RenderHandle<Self>, app: &App) -> MainAxisSize
Sourcepub fn set_main_axis_size(
self: RenderHandle<Self>,
app: &mut App,
value: MainAxisSize,
)
pub fn set_main_axis_size( self: RenderHandle<Self>, app: &mut App, value: MainAxisSize, )
Sourcepub fn cross_axis_alignment(
self: RenderHandle<Self>,
app: &App,
) -> CrossAxisAlignment
pub fn cross_axis_alignment( self: RenderHandle<Self>, app: &App, ) -> CrossAxisAlignment
Sourcepub fn set_cross_axis_alignment(
self: RenderHandle<Self>,
app: &mut App,
value: CrossAxisAlignment,
)
pub fn set_cross_axis_alignment( self: RenderHandle<Self>, app: &mut App, value: CrossAxisAlignment, )
Sourcepub fn text_direction(
self: RenderHandle<Self>,
app: &App,
) -> Option<TextDirection>
pub fn text_direction( self: RenderHandle<Self>, app: &App, ) -> Option<TextDirection>
Sourcepub fn set_text_direction(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TextDirection>,
)
pub fn set_text_direction( self: RenderHandle<Self>, app: &mut App, value: Option<TextDirection>, )
Sourcepub fn vertical_direction(
self: RenderHandle<Self>,
app: &App,
) -> VerticalDirection
pub fn vertical_direction( self: RenderHandle<Self>, app: &App, ) -> VerticalDirection
Sourcepub fn set_vertical_direction(
self: RenderHandle<Self>,
app: &mut App,
value: VerticalDirection,
)
pub fn set_vertical_direction( self: RenderHandle<Self>, app: &mut App, value: VerticalDirection, )
Sourcepub fn text_baseline(
self: RenderHandle<Self>,
app: &App,
) -> Option<TextBaseline>
pub fn text_baseline( self: RenderHandle<Self>, app: &App, ) -> Option<TextBaseline>
Sourcepub fn set_text_baseline(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TextBaseline>,
)
pub fn set_text_baseline( self: RenderHandle<Self>, app: &mut App, value: Option<TextBaseline>, )
Sourcepub fn clip_behavior(self: RenderHandle<Self>, app: &App) -> Clip
pub fn clip_behavior(self: RenderHandle<Self>, app: &App) -> Clip
Sourcepub fn set_clip_behavior(self: RenderHandle<Self>, app: &mut App, value: Clip)
pub fn set_clip_behavior(self: RenderHandle<Self>, app: &mut App, value: Clip)
Sourcepub fn spacing(self: RenderHandle<Self>, app: &App) -> f64
pub fn spacing(self: RenderHandle<Self>, app: &App) -> f64
Sourcepub fn set_spacing(self: RenderHandle<Self>, app: &mut App, value: f64)
pub fn set_spacing(self: RenderHandle<Self>, app: &mut App, value: f64)
Trait Implementations§
Source§impl ContainerRenderObjectMixin for RenderFlex
impl ContainerRenderObjectMixin for RenderFlex
Source§type ChildType = AnyRenderBox
type ChildType = AnyRenderBox
Flutter’s
ChildType: the protocol of this render object’s children.Source§type ParentDataType = FlexParentData
type ParentDataType = FlexParentData
Flutter’s
ParentDataType: the parent data this render object installs on its children.Source§fn container_data(
self: RenderHandle<Self>,
app: &App,
) -> &ContainerRenderObjectData<AnyRenderBox>
fn container_data( self: RenderHandle<Self>, app: &App, ) -> &ContainerRenderObjectData<AnyRenderBox>
Mixin field access.
Source§fn container_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut ContainerRenderObjectData<AnyRenderBox>
fn container_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut ContainerRenderObjectData<AnyRenderBox>
See
container_data.Source§fn child_count(self: RenderHandle<Self>, app: &App) -> usize
fn child_count(self: RenderHandle<Self>, app: &App) -> usize
The number of children.
Source§fn insert(
self: RenderHandle<Self>,
app: &mut App,
child: Self::ChildType,
after: Option<Self::ChildType>,
)
fn insert( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, after: Option<Self::ChildType>, )
Insert child into this render object’s child list after the given child. Read more
Source§fn add(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
fn add(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
Append child to the end of this render object’s child list.
Source§fn add_all(
self: RenderHandle<Self>,
app: &mut App,
children: Option<Vec<Self::ChildType>>,
)
fn add_all( self: RenderHandle<Self>, app: &mut App, children: Option<Vec<Self::ChildType>>, )
Add all the children to the end of this render object’s child list.
Source§fn remove(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
fn remove(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
Remove this child from the child list. Read more
Source§fn remove_all(self: RenderHandle<Self>, app: &mut App)
fn remove_all(self: RenderHandle<Self>, app: &mut App)
Remove all their children from this render object’s child list. Read more
Source§fn move_child(
self: RenderHandle<Self>,
app: &mut App,
child: Self::ChildType,
after: Option<Self::ChildType>,
)
fn move_child( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, after: Option<Self::ChildType>, )
Move the given
child in the child list to be after another child. Read moreSource§fn did_attach(
self: RenderHandle<Self>,
app: &mut App,
owner: Handle<PipelineOwner>,
)
fn did_attach( self: RenderHandle<Self>, app: &mut App, owner: Handle<PipelineOwner>, )
The body of Flutter’s
attach override: attaches every child in the list.Source§fn did_detach(self: RenderHandle<Self>, app: &mut App)
fn did_detach(self: RenderHandle<Self>, app: &mut App)
The body of Flutter’s
detach override: detaches every child in the list.Source§fn redepth_children(self: RenderHandle<Self>, app: &mut App)
fn redepth_children(self: RenderHandle<Self>, app: &mut App)
Flutter’s
redepthChildren: walks the child list.Source§fn visit_children(
self: RenderHandle<Self>,
app: &App,
visitor: &mut dyn FnMut(AnyRenderObject),
)
fn visit_children( self: RenderHandle<Self>, app: &App, visitor: &mut dyn FnMut(AnyRenderObject), )
Flutter’s
visitChildren: walks the child list.Source§fn first_child(self: RenderHandle<Self>, app: &App) -> Option<Self::ChildType>
fn first_child(self: RenderHandle<Self>, app: &App) -> Option<Self::ChildType>
The first child in the child list.
Source§fn last_child(self: RenderHandle<Self>, app: &App) -> Option<Self::ChildType>
fn last_child(self: RenderHandle<Self>, app: &App) -> Option<Self::ChildType>
The last child in the child list.
Source§fn child_before(
self: RenderHandle<Self>,
app: &App,
child: Self::ChildType,
) -> Option<Self::ChildType>
fn child_before( self: RenderHandle<Self>, app: &App, child: Self::ChildType, ) -> Option<Self::ChildType>
The previous child before the given child in the child list.
Source§fn child_after(
self: RenderHandle<Self>,
app: &App,
child: Self::ChildType,
) -> Option<Self::ChildType>
fn child_after( self: RenderHandle<Self>, app: &App, child: Self::ChildType, ) -> Option<Self::ChildType>
The next child after the given child in the child list.
Source§fn children_as_list(self: RenderHandle<Self>, app: &App) -> Vec<Self::ChildType>
fn children_as_list(self: RenderHandle<Self>, app: &App) -> Vec<Self::ChildType>
Returns a list containing the children of this render object. Read more
Source§impl RenderBox for RenderFlex
impl RenderBox for RenderFlex
Source§fn render_box_data(self: RenderHandle<Self>, app: &App) -> &RenderBoxData
fn render_box_data(self: RenderHandle<Self>, app: &App) -> &RenderBoxData
Mixin field access.
Source§fn render_box_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RenderBoxData
fn render_box_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut RenderBoxData
See
render_box_data.Source§fn setup_parent_data(
self: RenderHandle<Self>,
app: &mut App,
child: AnyRenderObject,
)
fn setup_parent_data( self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject, )
Installs
BoxParentData unless the child already has it. Read moreSource§fn compute_min_intrinsic_width(
self: RenderHandle<Self>,
app: &mut App,
height: f64,
) -> f64
fn compute_min_intrinsic_width( self: RenderHandle<Self>, app: &mut App, height: f64, ) -> f64
Computes the value returned by
get_min_intrinsic_width.
Do not call this function directly, instead, call
get_min_intrinsic_width. Read moreSource§fn compute_max_intrinsic_width(
self: RenderHandle<Self>,
app: &mut App,
height: f64,
) -> f64
fn compute_max_intrinsic_width( self: RenderHandle<Self>, app: &mut App, height: f64, ) -> f64
Computes the value returned by
get_max_intrinsic_width.
Do not call this function directly, instead, call
get_max_intrinsic_width. Read moreSource§fn compute_min_intrinsic_height(
self: RenderHandle<Self>,
app: &mut App,
width: f64,
) -> f64
fn compute_min_intrinsic_height( self: RenderHandle<Self>, app: &mut App, width: f64, ) -> f64
Computes the value returned by
get_min_intrinsic_height. Do not call this function
directly, instead, call get_min_intrinsic_height. Read moreSource§fn compute_max_intrinsic_height(
self: RenderHandle<Self>,
app: &mut App,
width: f64,
) -> f64
fn compute_max_intrinsic_height( self: RenderHandle<Self>, app: &mut App, width: f64, ) -> f64
Computes the value returned by
get_max_intrinsic_height. Do not call this function
directly, instead, call get_max_intrinsic_height. Read moreSource§fn compute_distance_to_actual_baseline(
self: RenderHandle<Self>,
app: &mut App,
baseline: TextBaseline,
) -> Option<f64>
fn compute_distance_to_actual_baseline( self: RenderHandle<Self>, app: &mut App, baseline: TextBaseline, ) -> Option<f64>
Returns the distance from the y-coordinate of the position of the box to the y-coordinate
of the first given baseline in the box’s contents, if any, or
None otherwise. Read moreSource§fn compute_dry_baseline(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
baseline: TextBaseline,
) -> Option<f64>
fn compute_dry_baseline( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, baseline: TextBaseline, ) -> Option<f64>
Computes the value returned by
get_dry_baseline. Read moreSource§fn compute_dry_layout(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
) -> Size
fn compute_dry_layout( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, ) -> Size
Computes the value returned by
get_dry_layout. Do not call this
function directly, instead, call get_dry_layout. Read moreSource§fn hit_test_children(
self: RenderHandle<Self>,
app: &mut App,
result: &mut BoxHitTestResult<'_>,
position: Offset,
) -> bool
fn hit_test_children( self: RenderHandle<Self>, app: &mut App, result: &mut BoxHitTestResult<'_>, position: Offset, ) -> bool
Override this method to check whether any children are located at the given position. Read more
Source§fn constraints(self: RenderHandle<Self>, app: &App) -> BoxConstraints
fn constraints(self: RenderHandle<Self>, app: &App) -> BoxConstraints
The box constraints most recently supplied by the parent. Read more
Source§fn get_min_intrinsic_width(
self: RenderHandle<Self>,
app: &mut App,
height: f64,
) -> f64
fn get_min_intrinsic_width( self: RenderHandle<Self>, app: &mut App, height: f64, ) -> f64
Source§fn get_max_intrinsic_width(
self: RenderHandle<Self>,
app: &mut App,
height: f64,
) -> f64
fn get_max_intrinsic_width( self: RenderHandle<Self>, app: &mut App, height: f64, ) -> f64
Source§fn get_min_intrinsic_height(
self: RenderHandle<Self>,
app: &mut App,
width: f64,
) -> f64
fn get_min_intrinsic_height( self: RenderHandle<Self>, app: &mut App, width: f64, ) -> f64
Source§fn get_max_intrinsic_height(
self: RenderHandle<Self>,
app: &mut App,
width: f64,
) -> f64
fn get_max_intrinsic_height( self: RenderHandle<Self>, app: &mut App, width: f64, ) -> f64
Source§fn get_dry_layout(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
) -> Size
fn get_dry_layout( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, ) -> Size
Source§fn get_dry_baseline(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
baseline: TextBaseline,
) -> Option<f64>
fn get_dry_baseline( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, baseline: TextBaseline, ) -> Option<f64>
Source§fn debug_cannot_compute_dry_layout(
self: RenderHandle<Self>,
failure: DryLayoutFailure<'_>,
)
fn debug_cannot_compute_dry_layout( self: RenderHandle<Self>, failure: DryLayoutFailure<'_>, )
Called from
compute_dry_layout or
compute_dry_baseline if this box does not support
calculating a dry layout. Read moreSource§fn get_distance_to_baseline(
self: RenderHandle<Self>,
app: &mut App,
baseline: TextBaseline,
only_real: bool,
) -> Option<f64>
fn get_distance_to_baseline( self: RenderHandle<Self>, app: &mut App, baseline: TextBaseline, only_real: bool, ) -> Option<f64>
Source§fn get_distance_to_actual_baseline(
self: RenderHandle<Self>,
app: &mut App,
baseline: TextBaseline,
) -> Option<f64>
fn get_distance_to_actual_baseline( self: RenderHandle<Self>, app: &mut App, baseline: TextBaseline, ) -> Option<f64>
Source§fn mark_needs_layout(self: RenderHandle<Self>, app: &mut App)
fn mark_needs_layout(self: RenderHandle<Self>, app: &mut App)
Mark this render object’s layout information as dirty. Read more
Source§fn perform_resize(self: RenderHandle<Self>, app: &mut App)
fn perform_resize(self: RenderHandle<Self>, app: &mut App)
Updates the box’s size using only the constraints. Read more
Source§fn apply_paint_transform(
self: RenderHandle<Self>,
app: &App,
child: AnyRenderObject,
transform: &mut Matrix4,
)
fn apply_paint_transform( self: RenderHandle<Self>, app: &App, child: AnyRenderObject, transform: &mut Matrix4, )
Multiply the transform from the parent’s coordinate system to this box’s coordinate
system into the given transform. Read more
Source§fn paint_bounds(self: RenderHandle<Self>, app: &App) -> Rect
fn paint_bounds(self: RenderHandle<Self>, app: &App) -> Rect
An estimate of the bounds within which this render object will paint: the box’s own size.
Source§fn has_size(self: RenderHandle<Self>, app: &App) -> bool
fn has_size(self: RenderHandle<Self>, app: &App) -> bool
Whether this render object has undergone layout and has a
size.Source§fn handle_event(
self: RenderHandle<Self>,
app: &mut App,
event: &PointerEvent,
entry: &BoxHitTestEntry,
)
fn handle_event( self: RenderHandle<Self>, app: &mut App, event: &PointerEvent, entry: &BoxHitTestEntry, )
Override this method to handle pointer events that hit this render object. Read more
Source§fn hit_test(
self: RenderHandle<Self>,
app: &mut App,
result: &mut BoxHitTestResult<'_>,
position: Offset,
) -> bool
fn hit_test( self: RenderHandle<Self>, app: &mut App, result: &mut BoxHitTestResult<'_>, position: Offset, ) -> bool
Determines the set of render objects located at the given position. Read more
Source§fn hit_test_self(
self: RenderHandle<Self>,
_app: &App,
_position: Offset,
) -> bool
fn hit_test_self( self: RenderHandle<Self>, _app: &App, _position: Offset, ) -> bool
Override this method if this render object can be hit even if its children were not hit. Read more
Source§fn set_size(self: RenderHandle<Self>, app: &mut App, size: Size)
fn set_size(self: RenderHandle<Self>, app: &mut App, size: Size)
Sets the size of this box. Call from
RenderObject::perform_layout or
RenderObject::perform_resize.Source§fn layout(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
parent_uses_size: bool,
)
fn layout( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, parent_uses_size: bool, )
See
AnyRenderBox::layout.Source§fn as_box(self: RenderHandle<Self>) -> AnyRenderBox
fn as_box(self: RenderHandle<Self>) -> AnyRenderBox
The type-erased
RenderBox handle. Free: the vtable is a const, and the id is copied.Source§fn as_object(self: RenderHandle<Self>) -> AnyRenderObject
fn as_object(self: RenderHandle<Self>) -> AnyRenderObject
The type-erased
RenderObject handle, through as_box.Source§fn adopt_child(self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject)
fn adopt_child(self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject)
Source§fn drop_child(self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject)
fn drop_child(self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject)
Source§fn mark_needs_paint(self: RenderHandle<Self>, app: &mut App)
fn mark_needs_paint(self: RenderHandle<Self>, app: &mut App)
Source§fn mark_needs_composited_layer_update(self: RenderHandle<Self>, app: &mut App)
fn mark_needs_composited_layer_update(self: RenderHandle<Self>, app: &mut App)
Source§fn mark_needs_compositing_bits_update(self: RenderHandle<Self>, app: &mut App)
fn mark_needs_compositing_bits_update(self: RenderHandle<Self>, app: &mut App)
Source§fn schedule_initial_layout(self: RenderHandle<Self>, app: &mut App)
fn schedule_initial_layout(self: RenderHandle<Self>, app: &mut App)
Source§fn parent(self: RenderHandle<Self>, app: &App) -> Option<AnyRenderObject>
fn parent(self: RenderHandle<Self>, app: &App) -> Option<AnyRenderObject>
Source§fn owner(self: RenderHandle<Self>, app: &App) -> Option<Handle<PipelineOwner>>
fn owner(self: RenderHandle<Self>, app: &App) -> Option<Handle<PipelineOwner>>
Source§fn debug_needs_layout(self: RenderHandle<Self>, app: &App) -> bool
fn debug_needs_layout(self: RenderHandle<Self>, app: &App) -> bool
Source§impl RenderBoxContainerDefaultsMixin for RenderFlex
impl RenderBoxContainerDefaultsMixin for RenderFlex
Source§fn default_compute_distance_to_first_actual_baseline(
self: RenderHandle<Self>,
app: &mut App,
baseline: TextBaseline,
) -> Option<f64>
fn default_compute_distance_to_first_actual_baseline( self: RenderHandle<Self>, app: &mut App, baseline: TextBaseline, ) -> Option<f64>
Returns the baseline of the first child with a baseline. Read more
Source§fn default_compute_distance_to_highest_actual_baseline(
self: RenderHandle<Self>,
app: &mut App,
baseline: TextBaseline,
) -> Option<f64>
fn default_compute_distance_to_highest_actual_baseline( self: RenderHandle<Self>, app: &mut App, baseline: TextBaseline, ) -> Option<f64>
Returns the minimum baseline value among every child. Read more
Source§fn default_hit_test_children(
self: RenderHandle<Self>,
app: &mut App,
result: &mut BoxHitTestResult<'_>,
position: Offset,
) -> bool
fn default_hit_test_children( self: RenderHandle<Self>, app: &mut App, result: &mut BoxHitTestResult<'_>, position: Offset, ) -> bool
Performs a hit test on each child by walking the child list backwards. Read more
Source§fn default_paint(
self: RenderHandle<Self>,
app: &mut App,
context: &mut PaintingContext,
offset: Offset,
)
fn default_paint( self: RenderHandle<Self>, app: &mut App, context: &mut PaintingContext, offset: Offset, )
Paints each child by walking the child list forwards. Read more
Source§impl RenderFlexMixin for RenderFlex
impl RenderFlexMixin for RenderFlex
Source§fn flex_data(self: RenderHandle<Self>, app: &App) -> &RenderFlexData
fn flex_data(self: RenderHandle<Self>, app: &App) -> &RenderFlexData
Mixin field access.
Source§fn flex_data_mut(self: RenderHandle<Self>, app: &mut App) -> &mut RenderFlexData
fn flex_data_mut(self: RenderHandle<Self>, app: &mut App) -> &mut RenderFlexData
See
flex_data.Source§fn direction(self: RenderHandle<Self>, app: &App) -> Axis
fn direction(self: RenderHandle<Self>, app: &App) -> Axis
The direction to use as the main axis.
Source§fn set_direction(self: RenderHandle<Self>, app: &mut App, value: Axis)
fn set_direction(self: RenderHandle<Self>, app: &mut App, value: Axis)
Sets
direction.Source§fn main_axis_alignment(self: RenderHandle<Self>, app: &App) -> MainAxisAlignment
fn main_axis_alignment(self: RenderHandle<Self>, app: &App) -> MainAxisAlignment
How the children should be placed along the main axis. Read more
Source§fn set_main_axis_alignment(
self: RenderHandle<Self>,
app: &mut App,
value: MainAxisAlignment,
)
fn set_main_axis_alignment( self: RenderHandle<Self>, app: &mut App, value: MainAxisAlignment, )
Sets
main_axis_alignment.Source§fn main_axis_size(self: RenderHandle<Self>, app: &App) -> MainAxisSize
fn main_axis_size(self: RenderHandle<Self>, app: &App) -> MainAxisSize
How much space should be occupied in the main axis. Read more
Source§fn set_main_axis_size(
self: RenderHandle<Self>,
app: &mut App,
value: MainAxisSize,
)
fn set_main_axis_size( self: RenderHandle<Self>, app: &mut App, value: MainAxisSize, )
Sets
main_axis_size.Source§fn cross_axis_alignment(
self: RenderHandle<Self>,
app: &App,
) -> CrossAxisAlignment
fn cross_axis_alignment( self: RenderHandle<Self>, app: &App, ) -> CrossAxisAlignment
How the children should be placed along the cross axis. Read more
Source§fn set_cross_axis_alignment(
self: RenderHandle<Self>,
app: &mut App,
value: CrossAxisAlignment,
)
fn set_cross_axis_alignment( self: RenderHandle<Self>, app: &mut App, value: CrossAxisAlignment, )
Sets
cross_axis_alignment.Source§fn text_direction(self: RenderHandle<Self>, app: &App) -> Option<TextDirection>
fn text_direction(self: RenderHandle<Self>, app: &App) -> Option<TextDirection>
Determines the order to lay children out horizontally and how to interpret
start and
end in the horizontal direction. Read moreSource§fn set_text_direction(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TextDirection>,
)
fn set_text_direction( self: RenderHandle<Self>, app: &mut App, value: Option<TextDirection>, )
Sets
text_direction.Source§fn vertical_direction(self: RenderHandle<Self>, app: &App) -> VerticalDirection
fn vertical_direction(self: RenderHandle<Self>, app: &App) -> VerticalDirection
Determines the order to lay children out vertically and how to interpret
start and end
in the vertical direction. Read moreSource§fn set_vertical_direction(
self: RenderHandle<Self>,
app: &mut App,
value: VerticalDirection,
)
fn set_vertical_direction( self: RenderHandle<Self>, app: &mut App, value: VerticalDirection, )
Sets
vertical_direction.Source§fn text_baseline(self: RenderHandle<Self>, app: &App) -> Option<TextBaseline>
fn text_baseline(self: RenderHandle<Self>, app: &App) -> Option<TextBaseline>
If aligning items according to their baseline, which baseline to use. Read more
Source§fn set_text_baseline(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TextBaseline>,
)
fn set_text_baseline( self: RenderHandle<Self>, app: &mut App, value: Option<TextBaseline>, )
Sets
text_baseline.Source§fn has_overflow(self: RenderHandle<Self>, app: &App) -> bool
fn has_overflow(self: RenderHandle<Self>, app: &App) -> bool
Whether the flex overflowed along the main axis. Read more
Source§fn clip_behavior(self: RenderHandle<Self>, app: &App) -> Clip
fn clip_behavior(self: RenderHandle<Self>, app: &App) -> Clip
How to clip the children that overflow along the main axis. Read more
Source§fn set_clip_behavior(self: RenderHandle<Self>, app: &mut App, value: Clip)
fn set_clip_behavior(self: RenderHandle<Self>, app: &mut App, value: Clip)
Sets
clip_behavior.Source§fn spacing(self: RenderHandle<Self>, app: &App) -> f64
fn spacing(self: RenderHandle<Self>, app: &App) -> f64
How much space to place between children in the main axis. Read more
Source§fn set_spacing(self: RenderHandle<Self>, app: &mut App, value: f64)
fn set_spacing(self: RenderHandle<Self>, app: &mut App, value: f64)
Sets
spacing.Source§fn debug_has_necessary_directions(self: RenderHandle<Self>, app: &App) -> bool
fn debug_has_necessary_directions(self: RenderHandle<Self>, app: &App) -> bool
Flutter’s
_debugHasNecessaryDirections: asserts the directions the current alignment
needs are available. Always returns true. Internal to the flex layout.Source§fn is_baseline_aligned(self: RenderHandle<Self>, app: &App) -> bool
fn is_baseline_aligned(self: RenderHandle<Self>, app: &App) -> bool
Whether the children are placed on a shared baseline: a
CrossAxisAlignment::Baseline
along a horizontal main axis. Internal to the flex layout.Source§fn get_cross_size(self: RenderHandle<Self>, app: &App, size: Size) -> f64
fn get_cross_size(self: RenderHandle<Self>, app: &App, size: Size) -> f64
The extent of
size along the cross axis. Internal to the flex layout.Source§fn get_main_size(self: RenderHandle<Self>, app: &App, size: Size) -> f64
fn get_main_size(self: RenderHandle<Self>, app: &App, size: Size) -> f64
The extent of
size along the main axis. Internal to the flex layout.Source§fn flip_main_axis(self: RenderHandle<Self>, app: &App) -> bool
fn flip_main_axis(self: RenderHandle<Self>, app: &App) -> bool
Whether to lay out left-to-right / top-to-bottom (
false), or right-to-left /
bottom-to-top (true). false when the layout direction does not matter (for instance,
there is no child). Internal to the flex layout.Source§fn flip_cross_axis(self: RenderHandle<Self>, app: &App) -> bool
fn flip_cross_axis(self: RenderHandle<Self>, app: &App) -> bool
The cross axis counterpart of
flip_main_axis. Internal to the
flex layout.Source§fn constraints_for_non_flex_child(
self: RenderHandle<Self>,
app: &App,
constraints: BoxConstraints,
) -> BoxConstraints
fn constraints_for_non_flex_child( self: RenderHandle<Self>, app: &App, constraints: BoxConstraints, ) -> BoxConstraints
The constraints an inflexible child is laid out with. Internal to the flex layout.
Source§fn constraints_for_flex_child(
self: RenderHandle<Self>,
app: &App,
child: AnyRenderBox,
constraints: BoxConstraints,
max_child_extent: f64,
) -> BoxConstraints
fn constraints_for_flex_child( self: RenderHandle<Self>, app: &App, child: AnyRenderBox, constraints: BoxConstraints, max_child_extent: f64, ) -> BoxConstraints
The constraints a flexible child is laid out with, given the main axis extent it was
allocated. Internal to the flex layout.
Source§fn get_intrinsic_size(
self: RenderHandle<Self>,
app: &mut App,
sizing_direction: Axis,
extent: f64,
child_size: fn(AnyRenderBox, &mut App, f64) -> f64,
) -> f64
fn get_intrinsic_size( self: RenderHandle<Self>, app: &mut App, sizing_direction: Axis, extent: f64, child_size: fn(AnyRenderBox, &mut App, f64) -> f64, ) -> f64
Flutter’s
_getIntrinsicSize: the intrinsic extent along sizing_direction, given the
extent in the other direction and a child_size that measures one child. Internal to
the flex layout.Source§fn debug_check_constraints(
self: RenderHandle<Self>,
app: &App,
constraints: BoxConstraints,
) -> Option<String>
fn debug_check_constraints( self: RenderHandle<Self>, app: &App, constraints: BoxConstraints, ) -> Option<String>
Flutter’s
_debugCheckConstraints: the error to report when a child has a non-zero flex
factor while the incoming main axis constraint is unbounded and that child would have to
fill it, or None when the constraints are usable. Internal to the flex layout.Source§fn compute_sizes(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
layout_child: impl FnMut(&mut App, AnyRenderBox, BoxConstraints) -> Size,
get_baseline: ChildBaselineGetter,
) -> LayoutSizes
fn compute_sizes( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, layout_child: impl FnMut(&mut App, AnyRenderBox, BoxConstraints) -> Size, get_baseline: ChildBaselineGetter, ) -> LayoutSizes
Flutter’s
_computeSizes: measures the children with layout_child, reads their
baselines with get_baseline when they are baseline aligned, and works out this flex’s
own size. Internal to the flex layout. Read moreSource§fn perform_layout(self: RenderHandle<Self>, app: &mut App)
fn perform_layout(self: RenderHandle<Self>, app: &mut App)
Sizes this flex and positions its children; see
RenderFlex for the algorithm.Source§fn paint(
self: RenderHandle<Self>,
app: &mut App,
context: &mut PaintingContext,
offset: Offset,
)
fn paint( self: RenderHandle<Self>, app: &mut App, context: &mut PaintingContext, offset: Offset, )
Paints the children, clipping them to this flex when they overflow the main axis.
Source§fn dispose(self: RenderHandle<Self>, app: &mut App)
fn dispose(self: RenderHandle<Self>, app: &mut App)
Flutter’s
dispose: drop the clip layer handle, then super.dispose().Source§fn setup_parent_data(
self: RenderHandle<Self>,
app: &mut App,
child: AnyRenderObject,
)
fn setup_parent_data( self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject, )
A flex child gets a
FlexParentData.Source§fn compute_min_intrinsic_width(
self: RenderHandle<Self>,
app: &mut App,
height: f64,
) -> f64
fn compute_min_intrinsic_width( self: RenderHandle<Self>, app: &mut App, height: f64, ) -> f64
The minimum intrinsic width of the children laid out in a flex.
Source§fn compute_max_intrinsic_width(
self: RenderHandle<Self>,
app: &mut App,
height: f64,
) -> f64
fn compute_max_intrinsic_width( self: RenderHandle<Self>, app: &mut App, height: f64, ) -> f64
The maximum intrinsic width of the children laid out in a flex.
Source§fn compute_min_intrinsic_height(
self: RenderHandle<Self>,
app: &mut App,
width: f64,
) -> f64
fn compute_min_intrinsic_height( self: RenderHandle<Self>, app: &mut App, width: f64, ) -> f64
The minimum intrinsic height of the children laid out in a flex.
Source§fn compute_max_intrinsic_height(
self: RenderHandle<Self>,
app: &mut App,
width: f64,
) -> f64
fn compute_max_intrinsic_height( self: RenderHandle<Self>, app: &mut App, width: f64, ) -> f64
The maximum intrinsic height of the children laid out in a flex.
Source§fn compute_distance_to_actual_baseline(
self: RenderHandle<Self>,
app: &mut App,
baseline: TextBaseline,
) -> Option<f64>
fn compute_distance_to_actual_baseline( self: RenderHandle<Self>, app: &mut App, baseline: TextBaseline, ) -> Option<f64>
A row’s highest child baseline, or a column’s first child baseline.
Source§fn compute_dry_baseline(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
baseline: TextBaseline,
) -> Option<f64>
fn compute_dry_baseline( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, baseline: TextBaseline, ) -> Option<f64>
The baseline
compute_distance_to_actual_baseline
would answer, measuring the children dry; a baseline-aligned flex answers its shared
baseline.Source§fn compute_dry_distance_to_highest_baseline(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
baseline: TextBaseline,
sizes: &LayoutSizes,
) -> Option<f64>
fn compute_dry_distance_to_highest_baseline( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, baseline: TextBaseline, sizes: &LayoutSizes, ) -> Option<f64>
Dry layout equivalent of
default_compute_distance_to_highest_actual_baseline.
Internal to the flex layout.Source§fn compute_dry_distance_to_first_baseline(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
baseline: TextBaseline,
sizes: &LayoutSizes,
) -> Option<f64>
fn compute_dry_distance_to_first_baseline( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, baseline: TextBaseline, sizes: &LayoutSizes, ) -> Option<f64>
Dry layout equivalent of
default_compute_distance_to_first_actual_baseline.
Internal to the flex layout.Source§fn compute_dry_layout(
self: RenderHandle<Self>,
app: &mut App,
constraints: BoxConstraints,
) -> Size
fn compute_dry_layout( self: RenderHandle<Self>, app: &mut App, constraints: BoxConstraints, ) -> Size
The size this flex would take, measuring the children dry.
Source§fn hit_test_children(
self: RenderHandle<Self>,
app: &mut App,
result: &mut BoxHitTestResult<'_>,
position: Offset,
) -> bool
fn hit_test_children( self: RenderHandle<Self>, app: &mut App, result: &mut BoxHitTestResult<'_>, position: Offset, ) -> bool
Hit tests the children in paint order.
Source§impl RenderObject for RenderFlex
impl RenderObject for RenderFlex
Source§fn render_object_data(self: RenderHandle<Self>, app: &App) -> &RenderObjectData
fn render_object_data(self: RenderHandle<Self>, app: &App) -> &RenderObjectData
Mixin field access.
Source§fn render_object_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RenderObjectData
fn render_object_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut RenderObjectData
See
render_object_data.Source§fn perform_layout(self: RenderHandle<Self>, app: &mut App)
fn perform_layout(self: RenderHandle<Self>, app: &mut App)
Do the work of computing the layout for this render object. Read more
Source§fn visit_children(
self: RenderHandle<Self>,
app: &App,
visitor: &mut dyn FnMut(AnyRenderObject),
)
fn visit_children( self: RenderHandle<Self>, app: &App, visitor: &mut dyn FnMut(AnyRenderObject), )
Calls
visitor for each immediate child.Source§fn did_attach(
self: RenderHandle<Self>,
app: &mut App,
owner: Handle<PipelineOwner>,
)
fn did_attach( self: RenderHandle<Self>, app: &mut App, owner: Handle<PipelineOwner>, )
The body of Flutter’s
attach override after super.attach(owner); the base body has
already run. The default attaches the children reported by
visit_children.Source§fn did_detach(self: RenderHandle<Self>, app: &mut App)
fn did_detach(self: RenderHandle<Self>, app: &mut App)
The body of Flutter’s
detach override after super.detach(). The default detaches
the children reported by visit_children.Source§fn redepth_children(self: RenderHandle<Self>, app: &mut App)
fn redepth_children(self: RenderHandle<Self>, app: &mut App)
Adjusts the depth of each child reported by
visit_children.Source§fn paint(
self: RenderHandle<Self>,
app: &mut App,
context: &mut PaintingContext,
offset: Offset,
)
fn paint( self: RenderHandle<Self>, app: &mut App, context: &mut PaintingContext, offset: Offset, )
Paint this render object into the given context at the given offset. Read more
Source§fn dispose(self: RenderHandle<Self>, app: &mut App)
fn dispose(self: RenderHandle<Self>, app: &mut App)
Release any resources held by this render object. Read more
Source§fn as_render_object(self: RenderHandle<Self>, app: &App) -> AnyRenderObject
fn as_render_object(self: RenderHandle<Self>, app: &App) -> AnyRenderObject
Dart’s implicit upcast of a concrete render object to
RenderObject: this object’s
type-erased handle, through the vtable the protocol recorded when it created it.Source§fn perform_resize(self: RenderHandle<Self>, _app: &mut App)
fn perform_resize(self: RenderHandle<Self>, _app: &mut App)
Updates the render object’s size using only the constraints. Read more
Source§fn setup_parent_data(
self: RenderHandle<Self>,
app: &mut App,
child: AnyRenderObject,
)
fn setup_parent_data( self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject, )
Sets up parent data for
child if it has none. Read moreSource§fn sized_by_parent(self: RenderHandle<Self>, _app: &App) -> bool
fn sized_by_parent(self: RenderHandle<Self>, _app: &App) -> bool
Whether the constraints are the only input to the sizing algorithm.
Source§fn apply_paint_transform(
self: RenderHandle<Self>,
app: &App,
child: AnyRenderObject,
transform: &mut Matrix4,
)
fn apply_paint_transform( self: RenderHandle<Self>, app: &App, child: AnyRenderObject, transform: &mut Matrix4, )
Applies the transform that would be applied when painting the given child to the
given matrix. Read more
Source§fn is_repaint_boundary(self: RenderHandle<Self>, _app: &App) -> bool
fn is_repaint_boundary(self: RenderHandle<Self>, _app: &App) -> bool
Whether this render object repaints separately from its parent. Read more
Source§fn always_needs_compositing(self: RenderHandle<Self>, _app: &App) -> bool
fn always_needs_compositing(self: RenderHandle<Self>, _app: &App) -> bool
Whether this render object always needs compositing. Read more
Source§fn mouse_tracker_annotation(
self: RenderHandle<Self>,
_app: &App,
) -> Option<MouseTrackerAnnotation>
fn mouse_tracker_annotation( self: RenderHandle<Self>, _app: &App, ) -> Option<MouseTrackerAnnotation>
Dart’s
this is MouseTrackerAnnotation: the annotation this render object implements,
read live each time the mouse tracker consults it. None for a render object that is
not an annotation, which is the default.Source§fn update_composited_layer(
self: RenderHandle<Self>,
app: &mut App,
old_layer: Option<AnyOffsetLayer>,
) -> AnyOffsetLayer
fn update_composited_layer( self: RenderHandle<Self>, app: &mut App, old_layer: Option<AnyOffsetLayer>, ) -> AnyOffsetLayer
Update the composited layer owned by this render object. Read more
Source§fn show_on_screen(
self: RenderHandle<Self>,
app: &mut App,
descendant: Option<AnyRenderObject>,
rect: Option<Rect>,
duration: Duration,
curve: Rc<dyn Curve>,
)
fn show_on_screen( self: RenderHandle<Self>, app: &mut App, descendant: Option<AnyRenderObject>, rect: Option<Rect>, duration: Duration, curve: Rc<dyn Curve>, )
Attempt to make (a portion of) this or a descendant
RenderObject visible on screen. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RenderFlex
impl !Send for RenderFlex
impl !Sync for RenderFlex
impl !UnwindSafe for RenderFlex
impl Freeze for RenderFlex
impl Unpin for RenderFlex
impl UnsafeUnpin for RenderFlex
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> ContainerRenderObjectBase for Twhere
T: ContainerRenderObjectMixin,
impl<T> ContainerRenderObjectBase for Twhere
T: ContainerRenderObjectMixin,
Source§fn insert(
self: RenderHandle<Self>,
app: &mut App,
child: Self::ChildType,
after: Option<Self::ChildType>,
)
fn insert( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, after: Option<Self::ChildType>, )
Flutter’s
ContainerRenderObjectMixin.insert.Source§fn remove(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
fn remove(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
Flutter’s
ContainerRenderObjectMixin.remove.Source§fn remove_all(self: RenderHandle<Self>, app: &mut App)
fn remove_all(self: RenderHandle<Self>, app: &mut App)
Flutter’s
ContainerRenderObjectMixin.removeAll.Source§fn move_child(
self: RenderHandle<Self>,
app: &mut App,
child: Self::ChildType,
after: Option<Self::ChildType>,
)
fn move_child( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, after: Option<Self::ChildType>, )
Flutter’s
ContainerRenderObjectMixin.move.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> RenderObjectBase for Twhere
T: RenderObject,
impl<T> RenderObjectBase for Twhere
T: RenderObject,
Source§fn dispose(self: RenderHandle<Self>, app: &mut App)
fn dispose(self: RenderHandle<Self>, app: &mut App)
Flutter’s
RenderObject.dispose body: releases the layer handle. An override calls it
last, where Dart writes super.dispose().Source§fn mark_needs_layout(self: RenderHandle<Self>, app: &mut App)
fn mark_needs_layout(self: RenderHandle<Self>, app: &mut App)
Flutter’s
RenderObject.markNeedsLayout body; an override calls it where Dart writes
super.markNeedsLayout().Source§fn show_on_screen(
self: RenderHandle<Self>,
app: &mut App,
descendant: Option<AnyRenderObject>,
rect: Option<Rect>,
duration: Duration,
curve: Rc<dyn Curve>,
)
fn show_on_screen( self: RenderHandle<Self>, app: &mut App, descendant: Option<AnyRenderObject>, rect: Option<Rect>, duration: Duration, curve: Rc<dyn Curve>, )
Flutter’s
RenderObject.showOnScreen.