Skip to main content

TableBorder

Struct TableBorder 

Source
pub struct TableBorder {
    pub top: BorderSide,
    pub right: BorderSide,
    pub bottom: BorderSide,
    pub left: BorderSide,
    pub horizontal_inside: BorderSide,
    pub vertical_inside: BorderSide,
    pub border_radius: BorderRadius,
}
Expand description

Border specification for Table widgets.

This is like Border, with the addition of two sides: the inner horizontal borders between rows and the inner vertical borders between columns.

The sides are represented by BorderSide objects.

Fields§

§top: BorderSide

The top side of this border.

§right: BorderSide

The right side of this border.

§bottom: BorderSide

The bottom side of this border.

§left: BorderSide

The left side of this border.

§horizontal_inside: BorderSide

The horizontal interior sides of this border.

§vertical_inside: BorderSide

The vertical interior sides of this border.

§border_radius: BorderRadius

The BorderRadius to use when painting the corners of this border.

It is also applied to DataTable’s Material.

Implementations§

Source§

impl TableBorder

Source

pub const fn new() -> TableBorder

Creates a border for a table.

All the sides of the border default to BorderSide::NONE; Dart’s named arguments are the setters.

Source

pub fn top(self, top: BorderSide) -> TableBorder

Dart TableBorder(top:).

Source

pub fn right(self, right: BorderSide) -> TableBorder

Dart TableBorder(right:).

Source

pub fn bottom(self, bottom: BorderSide) -> TableBorder

Dart TableBorder(bottom:).

Source

pub fn left(self, left: BorderSide) -> TableBorder

Dart TableBorder(left:).

Source

pub fn horizontal_inside(self, horizontal_inside: BorderSide) -> TableBorder

Dart TableBorder(horizontalInside:).

Source

pub fn vertical_inside(self, vertical_inside: BorderSide) -> TableBorder

Dart TableBorder(verticalInside:).

Source

pub fn border_radius(self, border_radius: BorderRadius) -> TableBorder

Dart TableBorder(borderRadius:).

Source

pub fn all( color: Color, width: f64, style: BorderStyle, border_radius: BorderRadius, ) -> TableBorder

A uniform border with all sides the same color and width.

Dart’s TableBorder.all defaults the sides to black solid borders, one logical pixel wide, with no radius.

Source

pub fn symmetric( inside: BorderSide, outside: BorderSide, border_radius: BorderRadius, ) -> TableBorder

Creates a border for a table where all the interior sides use the same styling and all the exterior sides use the same styling.

Source

pub fn dimensions(&self) -> EdgeInsets

The widths of the sides of this border represented as an EdgeInsets.

This can be used, for example, with a Padding widget to inset a box by the size of these borders.

Source

pub fn is_uniform(&self) -> bool

Whether all the sides of the border (outside and inside) are identical. Uniform borders are typically more efficient to paint.

Source

pub fn scale(&self, t: f64) -> TableBorder

Creates a copy of this border but with the widths scaled by the factor t.

The t argument represents the multiplicand, or the position on the timeline for an interpolation from nothing to self, with 0.0 meaning that the object returned should be the nil variant of this object, 1.0 meaning that no change should be applied, returning self (or something equivalent to self), and other values meaning that the object should be multiplied by t. Negative values are treated like zero.

Values for t are usually obtained from an Animation<f64>, such as an AnimationController.

See also:

Source

pub fn lerp( a: Option<TableBorder>, b: Option<TableBorder>, t: f64, ) -> Option<TableBorder>

Linearly interpolate between two table borders.

If a border is None, it is treated as having only BorderSide::NONE borders.

The t argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning a (or something equivalent to a), 1.0 meaning that the interpolation has finished, returning b (or something equivalent to b), and values in between meaning that the interpolation is at the relevant point on the timeline between a and b.

Source

pub fn paint( &self, canvas: &mut Canvas, rect: Rect, rows: &[f64], columns: &[f64], )

Paints the border around the given Rect on the given Canvas, with the given rows and columns.

Uniform borders are more efficient to paint than more complex borders.

The rows argument specifies the vertical positions between the rows, relative to the given rectangle. For example, if the table contained two rows of height 100.0 each, then rows would contain a single value, 100.0, which is the vertical position between the two rows (relative to the top edge of rect).

The columns argument specifies the horizontal positions between the columns, relative to the given rectangle. For example, if the table contained two columns of height 100.0 each, then columns would contain a single value, 100.0, which is the vertical position between the two columns (relative to the left edge of rect).

The vertical_inside border is only drawn if there are at least two columns. The horizontal_inside border is only drawn if there are at least two rows. The horizontal borders are drawn after the vertical borders.

The outer borders (in the order top, right, bottom, left, with left above the others) are painted after the inner borders.

The paint order is particularly notable in the case of partially-transparent borders.

Trait Implementations§

Source§

impl Clone for TableBorder

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TableBorder

Source§

impl Debug for TableBorder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TableBorder

Source§

fn default() -> TableBorder

Returns the “default value” for a type. Read more
Source§

impl PartialEq for TableBorder

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TableBorder

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,