Skip to main content

RenderTable

Struct RenderTable 

Source
pub struct RenderTable { /* private fields */ }
Expand description

A table where the columns and rows are sized to fit the contents of the cells.

Implementations§

Source§

impl RenderTable

Source

pub fn new( app: &mut App, text_direction: TextDirection, ) -> RenderHandle<RenderTable>

Creates a table render object with no rows or columns.

Dart’s columns, rows and children arguments are set_columns, set_rows and set_children, and its other named arguments are the setters: set_column_widths (empty), set_default_column_width (FlexColumnWidth::default_width), set_border, set_row_decorations, set_configuration (ImageConfiguration::EMPTY), set_default_vertical_alignment (TableCellVerticalAlignment::Top) and set_text_baseline.

Source

pub fn columns(self: RenderHandle<Self>, app: &App) -> usize

The number of vertical alignment lines in this table.

Changing the number of columns will remove any children that no longer fit in the table.

Changing the number of columns is an expensive operation because the table needs to rearrange its internal representation.

Source

pub fn set_columns(self: RenderHandle<Self>, app: &mut App, value: usize)

Sets columns.

Source

pub fn rows(self: RenderHandle<Self>, app: &App) -> usize

The number of horizontal alignment lines in this table.

Changing the number of rows will remove any children that no longer fit in the table.

Source

pub fn set_rows(self: RenderHandle<Self>, app: &mut App, value: usize)

Sets rows.

Source

pub fn column_widths( self: RenderHandle<Self>, app: &App, ) -> HashMap<usize, TableColumnWidthRef>

How the horizontal extents of the columns of this table should be determined.

If the map has no entry for a given column, the table uses the default_column_width instead.

The layout performance of the table depends critically on which column sizing algorithms are used here. In particular, IntrinsicColumnWidth is quite expensive because it needs to measure each cell in the column to determine the intrinsic size of the column.

This property can never return None. If it is set to None, and the existing map is not empty, then the value is replaced by an empty map. (If it is set to None while the current value is an empty map, the value is not changed.)

Source

pub fn set_column_widths( self: RenderHandle<Self>, app: &mut App, value: Option<HashMap<usize, TableColumnWidthRef>>, )

Source

pub fn set_column_width( self: RenderHandle<Self>, app: &mut App, column: usize, value: TableColumnWidthRef, )

Determines how the width of column with the given index is determined.

Source

pub fn default_column_width( self: RenderHandle<Self>, app: &App, ) -> TableColumnWidthRef

How to determine with widths of columns that don’t have an explicit sizing algorithm.

Specifically, the default_column_width is used for column i if column_widths[i] is absent.

Source

pub fn set_default_column_width( self: RenderHandle<Self>, app: &mut App, value: TableColumnWidthRef, )

Source

pub fn text_direction(self: RenderHandle<Self>, app: &App) -> TextDirection

The direction in which the columns are ordered.

Source

pub fn set_text_direction( self: RenderHandle<Self>, app: &mut App, value: TextDirection, )

Source

pub fn border(self: RenderHandle<Self>, app: &App) -> Option<TableBorder>

The style to use when painting the boundary and interior divisions of the table.

Source

pub fn set_border( self: RenderHandle<Self>, app: &mut App, value: Option<TableBorder>, )

Sets border.

Source

pub fn row_decorations( self: RenderHandle<Self>, app: &App, ) -> &[Option<Box<dyn Decoration>>]

The decorations to use for each row of the table.

Row decorations fill the horizontal and vertical extent of each row in the table, unlike decorations for individual cells, which might not fill either.

Source

pub fn set_row_decorations( self: RenderHandle<Self>, app: &mut App, value: Option<Vec<Option<Box<dyn Decoration>>>>, )

Source

pub fn configuration(self: RenderHandle<Self>, app: &App) -> &ImageConfiguration

The settings to pass to the row_decorations when painting, so that they can resolve images appropriately. See ImageConfiguration.

Source

pub fn set_configuration( self: RenderHandle<Self>, app: &mut App, value: ImageConfiguration, )

Source

pub fn default_vertical_alignment( self: RenderHandle<Self>, app: &App, ) -> TableCellVerticalAlignment

How cells that do not explicitly specify a vertical alignment are aligned vertically.

Source

pub fn set_default_vertical_alignment( self: RenderHandle<Self>, app: &mut App, value: TableCellVerticalAlignment, )

Source

pub fn text_baseline( self: RenderHandle<Self>, app: &App, ) -> Option<TextBaseline>

The text baseline to use when aligning rows using TableCellVerticalAlignment::Baseline.

Source

pub fn set_text_baseline( self: RenderHandle<Self>, app: &mut App, value: Option<TextBaseline>, )

Source

pub fn set_flat_children( self: RenderHandle<Self>, app: &mut App, columns: usize, cells: Vec<Option<AnyRenderBox>>, )

Replaces the children of this table with the given cells.

The cells are divided into the specified number of columns before replacing the existing children.

If the new cells contain any existing children of the table, those children are moved to their new location in the table rather than removed from the table and re-added.

Source

pub fn set_children( self: RenderHandle<Self>, app: &mut App, cells: Option<Vec<Vec<AnyRenderBox>>>, )

Replaces the children of this table with the given cells.

Source

pub fn add_row( self: RenderHandle<Self>, app: &mut App, cells: Vec<Option<AnyRenderBox>>, )

Adds a row to the end of the table.

The newly added children must not already have parents.

Source

pub fn set_child( self: RenderHandle<Self>, app: &mut App, x: usize, y: usize, value: Option<AnyRenderBox>, )

Replaces the child at the given position with the given child.

If the given child is already located at the given position, this function does not modify the table. Otherwise, the given child must not already have a parent.

Source

pub fn column( self: RenderHandle<Self>, app: &App, x: usize, ) -> Vec<AnyRenderBox>

Returns the list of RenderBox objects that are in the given column, in row order, starting from the first row.

Source

pub fn row(self: RenderHandle<Self>, app: &App, y: usize) -> Vec<AnyRenderBox>

Returns the list of RenderBox objects that are on the given row, in column order, starting with the first column.

Source

pub fn get_row_box(self: RenderHandle<Self>, app: &App, row: usize) -> Rect

Returns the position and dimensions of the box that the given row covers, in this render object’s coordinate space (so the left coordinate is always 0.0).

The row being queried must exist.

This is only valid after layout.

Trait Implementations§

Source§

impl RenderBox for RenderTable

Source§

fn compute_distance_to_actual_baseline( self: RenderHandle<Self>, app: &mut App, _baseline: TextBaseline, ) -> Option<f64>

Returns the baseline offset of the cell in the first row with the lowest baseline, and uses TableCellVerticalAlignment::Baseline.

Source§

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

Source§

fn setup_parent_data( self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject, )

Installs BoxParentData unless the child already has it. Read more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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

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

Source§

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

Source§

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

Source§

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<'_>, )

Called from compute_dry_layout or compute_dry_baseline if this box does not support calculating a dry layout. Read more
Source§

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>

Source§

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)

Updates the box’s size using only the constraints. Read more
Source§

fn size(self: RenderHandle<Self>, app: &App) -> Size

The size of this box.
Source§

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

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

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, )

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

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

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)

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, )

Source§

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

The type-erased RenderObject handle, through as_box.
Source§

fn adopt_child(self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject)

Source§

fn drop_child(self: RenderHandle<Self>, app: &mut App, child: AnyRenderObject)

Source§

fn mark_needs_paint(self: RenderHandle<Self>, app: &mut App)

Source§

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)

Source§

fn schedule_initial_layout(self: RenderHandle<Self>, app: &mut App)

Source§

fn parent(self: RenderHandle<Self>, app: &App) -> Option<AnyRenderObject>

Source§

fn owner(self: RenderHandle<Self>, app: &App) -> Option<Handle<PipelineOwner>>

Source§

fn attached(self: RenderHandle<Self>, app: &App) -> bool

Source§

fn debug_needs_layout(self: RenderHandle<Self>, app: &App) -> bool

Source§

impl RenderObject for RenderTable

Source§

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

Source§

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 visit_children( self: RenderHandle<Self>, app: &App, visitor: &mut dyn FnMut(AnyRenderObject), )

Calls visitor for each immediate child.
Source§

fn perform_layout(self: RenderHandle<Self>, app: &mut App)

Do the work of computing the layout for this render object. Read more
Source§

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 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)

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, )

Sets up parent data for child if it has none. Read more
Source§

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 redepth_children(self: RenderHandle<Self>, app: &mut App)

Adjusts the depth of each child reported by visit_children.
Source§

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, )

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

Whether this render object repaints separately from its parent. Read more
Source§

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>

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

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>, )

Attempt to make (a portion of) this or a descendant RenderObject visible on screen. Read more
Source§

fn interface(self: RenderHandle<Self>, id: TypeId) -> Option<Box<dyn Any>>

Dart’s object is RenderAbstractViewport for any interface: the erased handle of the interface id names, if this type implements it. Read more
Source§

fn dispose(self: RenderHandle<Self>, app: &mut App)

Release any resources held by this render object. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> RenderObjectBase for T
where T: RenderObject,

Source§

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)

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>, )

Flutter’s RenderObject.showOnScreen.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>